Specifically, what I’ve been doing is taking a particular set of geometry objects, and rendering them in different locations after modification.
I call draw(geometry) once, then modify the geometry, moving it to a different location, then drawing again, moving, drawing, etc. This way I can re-use the same geometry data without having to worry about redundant storage in multiple geometry objects.
The problem is, for some reason the GraphicsContext3D can’t seem to render more than 3 of these. Anything else disappears. Would there be inherent limits here?
Why don’t you use shape3d objects that share the same Geometry object??
Each shape can have it’s own transform, and you don’t need to store multiple times the geometry data.
Something like this I used to make copies of my terrain.
class MyShape extends Shape3D{
public MyShape(){ //Constructor called for the first time, creates the geometry.
setGeometry(createGeometry());
}
public MyShape(MyShape original){ //Constructor called for the other copies of the geometry.
setGeometry(original.getGeometry());
}
private Geometry createGeometry(){
//create your geometry data.
}
}
Hope this helps,
Rafael.-
Is there a good reason fro using immedaite mode?
In general I dont think J3D’s immediate mode has been kept up because noone uses it. If you are going to go immediate, you mihgt as well go straight to JOGL/LWJGL…
Pure immediate in Java3D = Xith3D with full Java3D features
I went for pure immediate for the full control you get… at least for testing purposes. I know of no other way how to make Java3D run fluently (low frame period variation).
Hmm. Fair enough if thats what you need, since J3D doesnt render unless the scene changes I woudl imagine the frame rate varies highly.