Jump to content
  • Advertisement
Sign in to follow this  

data structure for 3D Objects & Triangle stripe/fan

This topic is 4409 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I'm writing a (simple!) 3D engine and try to optimize the performance now. So far, that's the structure of my 3D objects: [3D_OBJECT]{ vertex_array: ARRAY[3D_VEC] normal_array: ARRAY[3D_VEC] uvw_array: ARRAY[3D_VEC] face_array: ARRAY[FACE] } [FACE]{ vertices: ARRAY[INTEGER] normals: ARRAY[INTEGER] uvw: ARRAY[INTEGER] } the 3d object has a compile method which loops through all faces and uses glBegin(gl_polygon) normal := normal_array[current_face.normals] gl_normal3d (normal.x, normal.y, normal.z) texcoord := uvw_array[current_face.uvw] gl_tex_coord2d(texcoord.x, texcoordy) vertex := vertex_array[current_face.vertices] gl_vertex3d (vertex.x, vertex.y, vertex.z) glEnd to compile the object into a Displaylist the draw method of the 3d object then calls the displaylist now my questions: 1. What can you say about my data structure? is it stupid? 2. i'd like to use gl_triangle_strip and gl_triangle_fan to make it faster... How can i calculate and implement the strips and fans in my datastructure? 3. have you any other things you can tell me to make it more performant? At the moment, i don't want to use VBO's yet, because i don't know much about them yet... Thanks :)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!