Adam B wrote:
InfluencingBounds, it's still only work 4 planes. Where is error? Thanks for help. here is the code:
The problem is that you are overlapping all the planes together. Go back to your basic definition of the plane equation and note:
Ax + By + Cz + D = 0
The +D is the important bit - it says where the normal described by A,B and C will cut through the appropriate axis. In your setup, you've got every cutting plane passing through the same point *and* the directions are opposite. Effectively, you are elminating all the object. eg
planes[2] = new Vector4d( 0, 1, 0, -0.3 ); planes[3] = new Vector4d( 0, -1, 0, -0.3 );
You have created two planes here that cut along the vertical (Y) axis. One cuts off everything to the left, one cuts off everything to the right. However, you have them running through exactly the same point -0.3 on the Y axis. That is, they are exactly the same plane, just with the normal pointed in opposite directions - ie you're removing *everything* in the Y axis direction. Given that you repeat this for all of them, I'm surprised you see anything at all, actually.
What you really want to do is trim within a bounding volume. So, with a normal that points along the -Y axis, offset it to +0.3. For the normal that points along the +Y axis, offset it to 0.3. That way you will now trim the model so that you see everything between -0.3 and +0.3, while removing everything outside it. ie
planes[2] = new Vector4d( 0, 1, 0, -0.3 ); planes[3] = new Vector4d( 0, -1, 0, 0.3 );
That should now do what you want.
-- Justin Couch http://www.vlc.com.au/~justin/ Java Architect & Bit Twiddler http://www.yumetech.com/ Author, Java 3D FAQ Maintainer http://www.j3d.org/ ------------------------------------------------------------------- "Look through the lens, and the light breaks down into many lights. Turn it or move it, and a new set of arrangements appears... is it a single light or many lights, lights that one must know how to distinguish, recognise and appreciate? Is it one light with many frames or one frame for many lights?" -Subcomandante Marcos -------------------------------------------------------------------
=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".