View Full Version : Landscape
03-01-2004, 04:58 AM
I am very new to OpenGL programing and was wondering. If I have a set of 3d-coordinates (x,y,z, is it possible to input that data in the form of an array and generating a 3d map of an area?
If so - where would be a good place to start?
03-01-2004, 06:32 AM
There are a lot of ways to send data to OpenGL. Other than glVertex3f or its siblings, you can use glDrawArrays. First, you have to enable it:
Then, you set OpenGL to use the array:
Modify the above to fit your needs...the 3 represents the number elements per vertex, GL_FLOAT is obviously the type of data for each element in the vertex, and 0 is the stride (the number of bytes between each vertex).
Finally, in your rendering code use:
replacing GL_POINTS with whatever primitives you're trying to draw for the array. When you get that to work, look up:
for some advanced options and ideas.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.