3D surface plot using Jogl or Open GL

Hi,I am new to this forum .. can any one suggest me how to implement 3D Mesh plot or surface plot using Jogl or open GL or lwjgl Libraries ..It would be great if some one can help me out in this as I am new to these jars Thanks in advance raghavan
[289 byte] By [raghavan_26a] at [2007-11-26 22:38:36]
# 1

Meshes are data structures, so the exact method by which you render them depends on how you store the data.

One way that worked for me was to have FloatBuffers for the vertices, normals, and texture coordinates. I would then have a list of index groups which consisted of material information and an IntBuffer of indices that would reference the vertices, normals, and texture coordinates buffers. If you're not using textures then you can just ignore the texture coordinate buffer. The FloatBuffers must all be of the same length and should be rewound before each frame.

Then you could use glVertexArrayPointer() and similar methods to submit the buffers. Loop the list of index groups and apply materials and then call glDrawElements().

This method allows for a very simple port to using vertex buffer objects for increased performance.

However, one thing to keep in mind is that the vertex, normal, and texture coordinate are lumped together this way. Thus for a cube, one corner would need to be 3 different coordinates because it has 3 different normals but only point.

m_ludwiga at 2007-7-10 11:50:42 > top of Java-index,Other Topics,Java Game Development...