Please help with Z and jit.world 2D

Sym's icon

Hey I just started using jit.phys and I'm stuck at a problem I think can be solved quite simple but I can't figure it out.

I have a patch and want the world to act in 2D so simply I added remove_plane z to my jit.world.

The jit.body object moves only on the x and y axis now, but the z axis is still shown in my worldbox and if I scale the z axis the phys.body is stuck.

Max Patch
Copy patch and select New From Clipboard in Max.

I attached the patch as copy compressed.
Would be really glad if someone can help me out!

matmat's icon

hi,
to remove z plane , you have to write "@remove_plane 3" and not "@remove_plane z" on jit.phys.world...

mathieu

Rob Ramirez's icon

mathieu is correct.

it's a little confusing when looking at the attrui, because the label of the attribute is displayed rather than the value.
if you look at the attributes list from the wheel menu, you should see something like: remove_plane (3 : z), indicating that it is in fact an integer (as well as the phys.world reference page).

if you want to create a 2D view, instead of the default perspective view of gl.render, you can set @ortho 1 on your gl.render, and adjust the size of the view with the gl.render @lens_angle attribute. something like @lens_angle 140 will show the entirety of the default phys.world box.

Sym's icon

thanks matmat and Rob that helped, I worked with the phys.world 2D example but couldn't recreate it for myself the same way from scratch.. I focused on the phys.world and forgot to add the attributes to the gl.render.

Thanks a lot!