Hi Robert, thanks for your help.
Yes, thats makes sense and it's exactly how I do it I think.
But does the relationship (1 to 1 to 1 to 1,
vertexarray,colorarray,normalarrat, textmaparray) still apply when you
use glDrawElements ?
For example a when creating a 3D cube, the same vertex could
You can't specify that with indices. Instead you will have to
duplicate those vertices which share the same position but have
different normals, colors and texture coordinates. Think of it this
way: You have an array of vertices, each defined by a position, color,
normal and texture coordinates.
In short, what mario is saying is that if you have the same vertex and
you want different texture coordinates for it (like if you want to
display the same texture on each side of a cube, the verts each need 3
different texture coordinates), it's no longer the same vertex but a
different vertex
Ok,
So the conclution is that it's not working the way I thought it
would :-)
I'm importing the vertex, colors and normals from a collada.xml and
it's build in a nice way with indices so I assumed they had OpenGL in
mind when they developed the format and therefore pursued with the
Most file format are built for efficiency. Often times they will
define all of the unique vertices, unique normals, unique texture
coordinates and then give you faces which have pointers to the 3
vertices, normals and texture coordinates for that face. That's ideal
because it's the smallest
Vertices, Texture coordinates, Normals and Colors have a 1 to 1 to 1
to 1 relationship. That means that for any given vertex, you can
define:
The vertex's location
The texture coordinate
The normal
The color
If you define 4 vertices (with or without any of the other attributes,
doesn't matter),
6 matches
Mail list logo