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?

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.