OSG Newbie wrote:
Thanks, that helps.

In my situation, I have primitives sharing same vertex and the normals are 
different for a vertex depending on the primitive. I guess 
Geometry.setNormalBinding should be BIND_PER_PRIMITIVE.

My question is how should I order the normals in the normal array in Geometry, 
or should I use Geometry.setNormalIndices() to specify the normal indices. If 
so, should I set the indices in the order of how I set the primitives.

No, avoid per-list indices (as in setNormalIndices() ) like the plague. They're a throwback to the early days of OpenGL, and they'll force you to use immediate mode (glBegin(), glEnd()), which is the slowest way to draw. The same thing goes for BIND_PER_PRIMITIVE.

The best way to accomplish what you're doing is to just duplicate the vertex coordinates where you need different normal values, and use BIND_PER_VERTEX for your normals. For example, if you're drawing a cube, go ahead and use 24 separate vertex coordinates, normals and texture coordinates (as opposed to 8 vertex/texture coordinates and 6 per-primitive normals). It may seem like extra work, but as you scale to bigger and bigger scenes, it'll draw much faster this way.

--"J"
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to