views:

39

answers:

0

Say I have NX*NY*NZ cells in a corner-point-grid. I have also a mask of NX*NY*NZ booleans that gives me which cells of the grid I have to draw.

I would like to create an efficient indexed quad array in Java3D (or OpenGL, it does not matter at the end, since the concepts below are the same) using less memory as possible.

For sake of simplicity I'm skipping to declare the normals of each face and really I do not need them since I'm using a flat shading and no lighting.

I have a color for each cell (this is based on a per-cell property).

Thus I'm listing the faces I need to draw based on the cells mask.

I find myself repeating the same point (belonging to different faces) several times to be able to give each face a color.

Do you have any hint about how to make it more efficient?