|
|
Back to UserFriendly Strip Comments Index
|
Attn: OpenGL gurus | by ataraxia | 2009-05-08 15:25:15 |
| Beginner's Mistake... :-) |
by datenwolf |
2009-05-09 03:47:59 |
A vertex is not just a position vector. A vertex consists of at least:
* position
* normal
* color
I suppose you want to draw really nice, sharp facets. Then in fact, you don't have 6, but actually 24 vertices (8 faces, each consisting of 3 vertices).
Vertices are shared beetween faces only then, if the faces are part of a continous smooth surface.
I think you can figure out the rest for yourself. I'd rename the "vertexes" array into "positions" and use the indices of "faces" to create an array "vertices" from the data in "positions".
Oh and if your teacher/tutor makes you using the immediate mode (glBegin(...) ... glEnd()), slap him the OpenGL3.1 specification around the head: The immediate mode has been removed from OpenGL3.1 and for OpenGL3.0 it's recommended not to use it (actually this was intended to happen for OpenGL2.x, but it was deferred to the 3.x-Versions)
|
|
[ Reply ] |
|
|
[Todays Cartoon Discussion]
[News Index]
|
|