Interleaved arrays oftenly are more efficient though. You can place those attributes (Position, Normal, etc.) in one common, interleaved array, or you use multiple arrays for each attribute in its own array. Thus for a cube we have 6 * 4 = 24 vertices (capital position, lower normal) X, Y, Z, x, y, zĪnd so on, I hope you get the idea. Position, Normal and a few other attributes form what is known as a vertex. While each corner positions is shared by 3 faces each, the face direction, the so called Normal, is very different on that corner depending which face you're looking at. A cube consists of 6 faces with 4 corners each. So after that introduction, let's say you got a model, like a cube. What OpenGL does is, it accepts a bunch of data and it is upon you to make OpenGL access this data so that the operations it performs on that data will result in a nice image on the screen. Maybe this surprises you, but OpenGL has no such thing qualifying as "models".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |