|
|
|
|
Possibility of no-render zones?
Posted:
Nov 4, 2009 6:53 AM
|
|
|
Hi, I just started in java 3D and I am wondering if it is possible to set up 3D zones where all objects are invisible? For instance, any part of any object with a positive Y-coordinate would be invisible.
I tried this with a BoundingBox but all that happens is that the objects in the 'invisible zone' are black but you can still see them when they pass in front of other objects.
My intention is to show cutaway type views of 3D scenes.
Many thanks Dave
|
|
|
|
|
|
|
Re: Possibility of no-render zones?
Posted:
Nov 4, 2009 7:46 AM
in response to: dwsubc
|
 |
Helpful |
|
|
Have you seen the ModelClip node? Sounds like that could do something like what you're asking.
Bill
|
|
|
|
|
|
|
|
Re: Possibility of no-render zones?
Posted:
Nov 4, 2009 7:55 AM
in response to: weiland
|
|
|
Many thanks Bill. It looks like this will do exactly what I want.
Thanks again for the quick reply. Dave
|
|
|
|
|
|
|
|
Re: Possibility of no-render zones?
Posted:
Nov 5, 2009 6:38 AM
in response to: dwsubc
|
|
|
Below is how I used Bill's idea to allow me to turn various parts of my scene invisible. For instance, to make the positive X half of the universe invisible, call mc.setEnable(0, true); You can combine these calls to show quarters or eigths as well.
I can now show cross sections, cutaways and segments of my scene. Very cool.
Dave
//Create Model Clip ModelClip mc = new ModelClip(); mc.setCapability(ModelClip.ALLOW_ENABLE_WRITE); boolean enables[] = { false, false, false, false, false, false }; mc.setEnables(enables); Vector4d vector4d = new Vector4d(1.0, 0.0, 0.0, 0.0);// +X mc.setPlane(0, vector4d); mc.setEnable(0, false); vector4d = new Vector4d(-1.0, 0.0, 0.0, 0.0);// -X mc.setPlane(1, vector4d); mc.setEnable(1, false); vector4d = new Vector4d(0.0, 1.0, 0.0, 0.0);// +Y mc.setPlane(2, vector4d); mc.setEnable(2, false); vector4d = new Vector4d(0.0, -1.0, 0.0, 0.0);// -Y mc.setPlane(3, vector4d); mc.setEnable(3, false); vector4d = new Vector4d(0.0, 0.0, 1.0, 0.0);// +Z mc.setPlane(4, vector4d); mc.setEnable(4, false); vector4d = new Vector4d(0.0, 0.0, -1.0, 0.0);// -Z mc.setPlane(5, vector4d); mc.setEnable(5, false); mc.setInfluencingBounds(bounds); objRoot.addChild(mc);
|
|
|
|
|