IndexedGeometryStripArray subclasses

Can someone please explain the point of the following classes in the Java3D scene graph?

IndexedLineStripArray
IndexedTriangleStripArray
IndexedTriangleFanArray

Why would you use these? How would you use these? Reading the API specification isn’t helping me understand these two questions.

I’m guessing the same way you’d use them in GL.

RELAX! I wasn’t really going to leave you with that. ;D I’m not really up to speed on Java3D, but I’m assuming that these are collections of points that descrbe a set of lines, or triangles. For example, if I was drawing a cube, I could start with one vertex and keep drawing lines until I completed the cube. This way I’d only describe each vertex once instead of 6 QUAD polygons or 12 triangle polygons. Of course, why you’d use these directly in a scenegraph that handles most of it for you, is beyond me. They’re probably there for the SceneGraph’s use and where made public in case you wanted to create your own object types.

Does that help?

Well I understand the XXXStripArray classes it’s the indexed ones I don’t get. There seems to be a level of indirection in these and I can’t figure out what it’s for.

With the indexed classes you can send a array of indexes along with the vertex data to the constructors. I guess so you can say I want the first vertext to really be the fifth vertex. So you get the value of the 0th element of the index array and this value is 4 meaning go get the 5th element in the vertex array.

This is totally freaking confusing and I can’t figure out why anyone would want to use this.

Resuse of vertices? An array of strips can have vertices used by several strips.

Additionally, colors and texture coords can be indexed seperately.

AFAIK, these classes are bad - performance wise - as long as the separate coord-color-texture indexing is used.

Alright then I’m going to leave these out of my scene graph code. Thanks.

Okay I think I know what these are for now. It is mainly for reusing the vertices and dealing with OpenGLs Vertex Array lists which can give you huge performance gains.

As I said.

These Java3D guys are not stupid… 8)

But the indexing stuff can lead to a complete rollout of the structures somewhere deep within J3D.