hello everyone!

i have some little problem understanding the use of colors in opensg, so i'll put u several stupid questions, just to get compfy with this stuff... I want to assign color values per vertex, so i retrive the meshes informations from the scene graph. Then i triangleiterate throug the meshes and vertex navigate throug the single trinagles...

my code looks like:

for every mesh
   for every triangle
          for every vertex
                {
                        getvertexinfo (position and normal)
                        calculate_color(color_per_vertex)
                        push_back_color(color_per_vertex)
                }


and then befeore any rendering take place:

for every mesh
      mesh->set_color(color_per_vertex)

but it doesn't work. Now i am thinking that i am wrong parsing the whole stuff: i put in the set_color function an explicit color array, with an entry for every indexed vertex... now maybe i should simply calculate one color for any NON-indexed vertex...

in numbers: if i had a stupid cube with 8 vertices i'd have 36 indices (6 faces => 12 triangles, 3 vertices per triangle). Now during the color assigning, how many colors will i have to pass? 8, one for every vertex, or 36, one for every INDEXED-vertex????
I am confused....

next some pratical questions: how can i know how many triangles and vertices are there intoa geoNode?? is there a geoptr->getTriangleNumber() - geoptr->getVertexNumber() method??? If i have to pass a color just for the single color (8 colors for the cube) i'd need to know how many vertices i have to create the right amount of space in my geoColors3f array....

how can i index my color array in the right way? AKA same index for vertex array and color array?

thx guys !!

_________________________________________________________________
Personalizza MSN Messenger con sfondi e fotografie! http://www.ilovemessenger.msn.it/



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to