The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Attn: OpenGL gurus by ataraxia2009-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]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)