responsive 3d meshes

I want to draw a 3D mesh that responds quickly in real time to input actions, by changing the z axis value when i click my mouse. So for example if i click on (x,y) with my mouse then the point in my mesh will go to (x,y,0) to (x,y,20)

I’ve tried two methods so far. Firstly just redrawing a bunch of squares directly according to the input values but the drawing seems too slow for realtime viewing

Next I drew a mesh by having a display list which was a line and then rotating and translating this line to draw the mesh. This responds well, the problem now is that I can’t add any colour or surface texture because I’m using lines. (I guess I could try using triangles instead of lines to get a surface but i’m afraid of the complex trigonomatory and rotations that it will involve)

Surely hundreds of people have done this before. Is there a best method bearing in mind i need a quick response of graphics to the mouse click


Look into vertex arrays (VARS) for rendering high polygon count meshes. It’s the fastest way to render geometry.