Original Post
🔒 Locked
vertex array tutorials
Advertisement
I believe the heightmap demo''s on game tutorials uses vertex arrays for rendering. It''s not difficult though. Basically it''s:
This is just off the top of my head so you might want to check the OpenGL docs for the exact syntax.
Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]
GSACP: GameDev Society Against Crap Posting
To join: Put these lines in your signature and don''t post crap!
//create the arrays
float VertexArray[64*3]; //array for 64 vertices (3 floats per vertex)
float TexArray[64*2]; //array for 64 vertex texCoords (2 coords per vertex)
//store some data in it
FillArraysWithData();
//tell OpenGL where to find the stuff
glVertexPointer(3, GL_FLOAT, 0, VertexArray);
glTexCoordPointer(2, GL_FLOAT, 0, TexArray);
//tell OpenGL to render a 64 vertex triangle strip
glDrawArrays(GL_TRIANGLE_STRIP, 64);
This is just off the top of my head so you might want to check the OpenGL docs for the exact syntax.
Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]
GSACP: GameDev Society Against Crap Posting
To join: Put these lines in your signature and don''t post crap!
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement