glVertexPointer Problem
I am trying to create a Structured Object to hold the info for the pointer but can't seem to get it to work right here is the structure
struct vec3D { GLfloat x,y,z; }; typedef struct vec3D the3DVector;
struct triAngle { the3DVector point[3]; GLint type; }theObj[Array Number];
When I take out ( GLint type ) it works but when i try to use it it doesn't work am i missing something or can this type of struture not work?
struct vec3D { GLfloat x,y,z; }; typedef struct vec3D the3DVector;
struct triAngle { the3DVector point[3]; GLint type; }theObj[Array Number];
When I take out ( GLint type ) it works but when i try to use it it doesn't work am i missing something or can this type of struture not work?
that structure can't work because there's not the same distance between each vertex.
I was hoping I was wrong about that because I only wanted to point to the Points of the object an not the Points & type (i.e obj[0]->point,obj[1]->point an so on)
is there any way I can create a Obj that has 3Points An a Data Type?
is there any way I can create a Obj that has 3Points An a Data Type?
You can stick the type in a union within the struct. This way, as long as your vector size is wider, you can skip that part of the struct by drawing indices instead. However, it's a big fat waste of gpu memory and you're better off tightly packing your verts anyway.
I recommend just keeping a pointer to the offset of your vertex data in your triangle or object struct.
I recommend just keeping a pointer to the offset of your vertex data in your triangle or object struct.
---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Thanks for the Tips & advice but fortunately I have found a new & Better way to create a object with a data type thanks for the help
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| VBO + glVertexPointer + NSMutableArray... | brush | 7 | 4,683 |
Jun 15, 2008 01:45 AM Last Post: mcMike |
|
