GLdouble **vertexArray;
vertexArray = new GLdouble*[map_info->w * map_info->h];
//... blah blah
for(int k = 0; k < map_info->h; k++)
{
for(int i = 0; i < map_info->w; i++)
{
vertexArray[i+(k*map_info->h)] = new GLdouble[3];
vertexArray[i+(k*map_info->h)][0] = i; // x
vertexArray[i+(k*map_info->h)][1] = avg*INTENSITY; // y (height)
vertexArray[i+(k*map_info->h)][2] = k; // z
}
}
GLubyte *indexArray;
indexArray = new GLubyte[map_info->w * map_info->h];
for(int k = 0; k < map_info->h; k++)
{
for(int i = 0; i < map_info->w; i++)
{
vertexArray[i+(k*map_info->h)] = new GLdouble[3];
vertexArray[i+(k*map_info->h)][0] = i; // x
vertexArray[i+(k*map_info->h)][1] = avg*INTENSITY; // y (height)
vertexArray[i+(k*map_info->h)][2] = k; // z
indexArray[i+(k*map_info->h)] = i+(k*map_info->h); // Index Array...
}
}
glVertexPointer((map_info->w-1) * (map_info->h-1)*3, GL_DOUBLE, 0, vertexArray);
glDrawElements(GL_POINTS, (map_info->w * map_info->h), GL_UNSIGNED_BYTE, indexArray);