Hi Aitor, The center of the code defaults to the center of mass of the cone, hence the 0.25 value.
Robert. On Thu, Feb 14, 2008 at 2:12 PM, Aitor Moreno <[EMAIL PROTECTED]> wrote: > Hi osg-users, > > I am trying to do a very simple application, and when I was required to add > some cones, I added a new osg::Cone with the desired parameters. > Unfortunatelly, the cone didn't appeared where it was suppossed to. > > I clean up the code and I copy here a snipset of the code I used and a > screenshot. > > This code adds a Cone and a Box. > Both objects with the same origin. The box is only for reference (it > represents the XY plane at z=0). > > As you can see in the attached screenshot, the cone is displaced 25% below > the XY plane (100 units). Its size is 400. > > I was expected to that the bottom of the cone at z=0. Or, as in other API's, > the center of the cone at z=0. > > Any ideas? is it a bug? > > Thanks > > > =============== CODE ======================= > > ViewerQT* viewerWindow = new ViewerQT; > > //create a group and add the loaded model => terrain > osg::ref_ptr<osg::Group> groupRoot = new osg::Group; > > //Add the Cone > osg::Geode* geo = new osg::Geode(); > geo->addDrawable(new osg::ShapeDrawable(new > osg::Cone(osg::Vec3(0,0,0), 50, 400))); > geo->addDrawable(new osg::ShapeDrawable(new osg::Box( > osg::Vec3(0,0,0) , 100, 100, 0.05f ))); > groupRoot->addChild ( geo); > > //set camera and set the root node. > viewerWindow->setCameraManipulator(new osgGA::TrackballManipulator); > > osg::ref_ptr<osgText::Text> updateText = new osgText::Text; > // add the HUD subgraph. > groupRoot->addChild(createHUD(updateText.get())); > viewerWindow->addEventHandler(new PickHandler(updateText.get())); > > viewerWindow->setSceneData(groupRoot.get()); > > =============== CODE ======================= > > -- > Aitor Moreno > aitormoreno [EMAIL PROTECTED] gmail.com > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

