Hello Renan, > But the thing is: I need these shapes to be created from the osg::Geometry > class, as a matter of compatibility with another class. Do you know how to > create the specific shapes I told you about (sphere, cylinder and box)?
Your question could be two things: a) If you're asking how to specify vertex coordinates and indices in order to make a model in an osg::Geometry, then look at the tutorials that were mentioned. It's basically down to filling vertex and index arrays, and those tutorials have example code. You can also look at the osggeometry example. b) If you're asking how to calculate the appropriate vertices and indices to make a sphere, a cylinder or a box, then it's a purely mathematical exercise. For a box it's simple... For a sphere and a cylinder, there are a few ways, I urge you to try it yourself (hint: a bunch of vectors going in different directions around the origin, when normalized, will give a coarse or fine approximation of a circle, depending on how many vectors you used). If you're really in a hurry I'm sure I can dig up some old code, but really, it's an exercise that's given in any basic Computer Graphics course (and the old code I would give you is exactly that, the answers I gave to that exercise in my basic Computer Graphics course :-) ). You could also load up Blender, make a sphere or a cylinder, and export it to .osg with osgExporter (or any other format you can read - or any other modeling tool you have). But doing it mathematically is pretty easy too. Good luck, J-S -- ______________________________________________________ Jean-Sebastien Guay [EMAIL PROTECTED] http://whitestar02.webhop.org/ ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org