Forums > Jitter

position a sphere IN a cube jit.gl.gridshape advice?

November 16, 2006 | 4:20 pm

Hello,
I’ve mangled together a patch (Still learning…) using jit.gl.gridshape and handle that attempts to place four small spheres in a cube or sphere shape. (like a box of balls for example.)

By changing the camera angle, i am SURE they ARE positioned in the sphere.

However, the drawing order is often incorrect, resulting in a not-so-real effect. i.e. the sphere is drawn over the mesh cube, or visa versa.

Using layer and automatic results in either ALL balls being drawn in front, or behind, the cube.

Is what i’m asking impossible, and should i instead render 6 planes to make a cube, and then set the order via layer or automatic?

The camera will be static in the end, so i will place all the balls on one layer, (it doesn’t matter if this is unrealistic) and the planes on separate layers.

Silly way to go?

Thanks,
Phil


November 16, 2006 | 5:11 pm

do you have @depth_enable 1 on all of your targets, as well as
@depthbuffer 1 on your jit.window?

v a d e //

http://www.vade.info
abstrakt.vade.info

On Nov 16, 2006, at 11:20 AM, Philip Reeder wrote:

>
> Hello,
> I’ve mangled together a patch (Still learning…) using
> jit.gl.gridshape and handle that attempts to place four small
> spheres in a cube or sphere shape. (like a box of balls for example.)
>
> By changing the camera angle, i am SURE they ARE positioned in the
> sphere.
>
> However, the drawing order is often incorrect, resulting in a not-
> so-real effect. i.e. the sphere is drawn over the mesh cube, or
> visa versa.
>
> Using layer and automatic results in either ALL balls being drawn
> in front, or behind, the cube.
>
> Is what i’m asking impossible, and should i instead render 6 planes
> to make a cube, and then set the order via layer or automatic?
>
> The camera will be static in the end, so i will place all the balls
> on one layer, (it doesn’t matter if this is unrealistic) and the
> planes on separate layers.
>
> Silly way to go?
>
> Thanks,
> Phil


November 16, 2006 | 5:36 pm

thanks Vade, I’d checked that (i searched the forums a lot!), wrote my post, went ahead and built the cube out of planes,
which worked great.
Read your reply and realised I DIDN’T have depth_enable on the final jit.gl.render .
Sorry…and many thanks.
Phil
EDIT: still does it… wierd. Anyway, I built the planes so consider this not an urgent query…


Viewing 3 posts - 1 through 3 (of 3 total)