So far i''m working with display lists, but i''d like to "upgrade" to Vertex arrays. I''ve tried to make it but i was not successful. At the following link, there is a complete VC++ project (only 28k) which render a textured cube using a display list. If someone could please modify it into vertex arrays i''d be very grateful.
Thanks anyway
here is the link: www.web-discovery.net/downloads/cube.zip
www.web-discovery.net
You data structure is not designed for vertex arrays. In vertex arrays, you must have an array of "super-vertexes". But in the philosophy of vertex arrays, a "super-vertex" is not only a 3D vector. It also contains all the associated data (texture coordinates and normals in your example).
For your cube, you should have 24 "super-vertexes" ! That is you should have 24 vertexes, 24 texture coordinates and 24 normals. But in your code, there's 8 vertexes, 12 texture coordinates and 6 normals. You don't want to duplicate coordinates, and that's an honourable purpose, but unfortunately it's not a valuable structure for vertex arrays.
[edited by - vincoof on September 16, 2002 10:59:18 AM]
penetrator, I have code that draws the nehe texture cube (lesson 7) both in vertex arrays and in vertex arrays using the VAR extension. If you want it email me at nitzanw@yahoo.com and I will email you this code.
quote:Original post by vincoof For your cube, you should have 24 "super-vertexes" ! That is you should have 24 vertexes, 24 texture coordinates and 24 normals. But in your code, there''s 8 vertexes, 12 texture coordinates and 6 normals. You don''t want to duplicate coordinates, and that''s an honourable purpose, but unfortunately it''s not a valuable structure for vertex arrays.
I really think that cube is ''very bad'' example to demonstrate the use vertex array