Hi Chiristian,

Christian Sam wrote:
Hi,

thank you for the reply. to give you some more information of my
situation: i want to visualize certain roof types. i generate the
geometry information (vertices, tex-coords, normals) programmatically
in my application. i'm using triangle_strips with drawElements
indices to construct my roof types - one reason for this is, i have
to insert some "index-swaps" to get certain roofforms done with only
one triangle_strip primitive per roof.

the next step would be to calculate the normal vectors. my first (and
most confortable) idea was to use the osg::smoothingVisitor. the
problem arrived with that was, i was getting averaged normals, which
didn't represent roofs very well.

so i was looking for another way where i could use for every planar
face of my triangle_strip its own normals to get facetted looking
roofs and posted here in this thread the question how to do this.

now, after some further research, i'm currently thinking, due the
circumstance of shared vertices in a triangle_strip, it is impossible
to assign multiple normals to one vertex. i' ve read of a
"workaround" where to use one normal for every triangle_strip's
planar face in addition and using FLATSHADING. i know this is not the
same like the above mentioned in SMOOTHSHADING, but i think it would
certainly better than the average normals.

so what do you think of that approach, or maybe you might have some
other ideas?

Sounds like you need fine grained control over the normals anyway, so it would be best if you just calculate them programmatically together with the other data. I think most people would nowadays advise to just specify normals per vertex and not try to use normals per face (slow path). As for multiple normals per vertex, you would have to create multiple normal arrays, but you can reuse the same vertex array.

E.g.

primitive 1 = vertex_array_shared + normal_array1 + drawelements
primitive 2 = vertex_array_shared + normal_array2 + drawelements

rgds
jp


Best Regards, Christian Sam

------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=11799#11799





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



--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

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

Reply via email to