www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: stormp on July 02, 2007, 06:25:03 am

Title: poly clipping outside box.
Post by: stormp on July 02, 2007, 06:25:03 am
Hi, is there a way that I can clip the world outside a defined box?  That is, I want to define a box around my scene and only see the poly's that are contained inside the box no matter where I place the camera.

Thanks for any suggestions.

S.
Title: Re: poly clipping outside box.
Post by: EgonOlsen on July 03, 2007, 10:45:34 am
That's not supported ATM and i'm not sure if there is a good way to fake it. What exactly do you want to do with this? Maybe there's another way to get the desired effect.
Title: Re: poly clipping outside box.
Post by: halcor on July 03, 2007, 01:22:23 pm
Maybe it's possible to attach a VertexController to all your objects, which performs the collision test for each poly and if it should be invisible - then modify vertex coordinates, so they are behind the camera and won't be seen on scene render. But this way you can clip whole polygons - you cannot clip (or at least not too easy) a poly if it should be partially visible.
Title: Re: poly clipping outside box.
Post by: stormp on July 18, 2007, 12:14:11 am
I was trying to make a floating scale/grid box around the surface of my scene.  The grid would start at the full view and have a variable depth.  As you moved it around the scene only the objects or parts of the objects that fell within the boxed scale would be rendered.  I would always have a reference point to the XYZ scale this way.  It wasn't absolutely necessary for me to do this - I just thought it would be a cool useful effect.   If anyone one has ideas I'm all ears :-)  Thanks for the input.

S.