Questions

Started by DavidYazel, June 30, 2003, 00:58:34

Previous topic - Next topic

DavidYazel

I am working on the underlying data structures for my engine and had a couple of questions:

1. Could someone explain Math order versus OpenGL order as matrices are concerned?

2. Is there a compelling reason not to use the vecmath package?  I only ask because I know we use it both on client and server and I wanted to minimize the impact to replacing the Java3d renderer.  If I was to use vecmath for everything prior to the rendering, then convert to the lwjgl standard before rendering would that work?  vecmath does not use any j3d dll's right?

3. Can I use an NIO IntBuffer for the indices for indexed geometry?

4. Java3d forced us to use the same indices for color, normals, coordinates, etc.  Does openGL let you specify different indices for these?  It is painful to replicate the same normals and colors 1000's of times when there is only a few unique ones.

Thanks!

Dave

princec

1. No, it always baffles me :P Basically, it's laid out in memory the other way round from what you're expecting. In practise this doesn't really have much effect as it's all encapsulated in the Matrix classes.

2. It doesn't make any difference which vecmath package you use - we provided one just for completeness. And it's not nearly as complete as Sun's one anyway. Stick with what you've got.

3. Yes, but apparently unsigned shorts are somewhat faster on most cards.

4. The reason J3D forced you to do that is because that's how graphics cards work. Every vertex needs to be fully specified. However if you're changing colour only occasionally, consider not using it in an array at all but sorting your geometry by colour and using a single glColor4ub() command to change the current GL colour. It probably won't save you a great deal of time.

Cas :)

DavidYazel

Thanks for the answers!

Dave