CameraToPhysic2d

Apr 2, 2012 at 8:39am

CameraToPhysic2d

Hi,
Here a cool patch for making 2d detection with physics objects….

Attachments:
  1. CameraToPhys2d.zip
#62726
Apr 2, 2012 at 9:18am

thx for sharing.

#226511
Apr 2, 2012 at 11:13am

great!
“phys2d” and “phys2dworld” I know it from somewhere :)
anyway thanks for sharing!

#226512
Apr 2, 2012 at 7:50pm

so much fun!

#226513
May 13, 2012 at 11:02am

Thanks! This is great! Just a question, any idea why is reacting good with the poly objects but not at all with phys.mult? Also, i had problem since i enable the worldbox (couse i need it active)…

#226514
May 13, 2012 at 12:34pm

hi,
here with phys.multiple and worldbox on …

– Pasted Max Patch, click to expand. –
#226515
May 13, 2012 at 1:30pm

Thanks a lot! Is there a limitation of size for multiple objects? like 0.5 in your patch? Because as soon as i change the scale from 0.5 to small cubes (for exemple 0.3) it stop reacting. Can it be they become too small for the phys to recognize them and collide? (sorry my english)

#226516
May 13, 2012 at 9:26pm

here an another example with random scale…

– Pasted Max Patch, click to expand. –
#226517
May 15, 2012 at 10:12am

Thanks a lot, now everything is getting much more clear to understand! :)

#226518
Sep 2, 2012 at 5:35pm

Thanks for this wonderful example. Recently i looked for the first time into the new physics objects, and your patch is a great help. Just a few questions if you don’t mind:

- if my camera input is 16:9 instead of 4:3, do i just have to rescale the videoplane to 17.777 10 instead 13.4 10 + the jit.phys.body to 1.77 1. 1. instead 1.33 1 1 ?

- why are the dimensions of the float matrix 100 100?

- if i change the jit.expr *10 and the scale-arguments for position in the poly accordingly, i can modify the width / height of the “collision area” ?

#226519
Sep 3, 2012 at 4:27am

and one additional question:
if i want a sound played with each new collision contact with the video matrix and use the @collisions 1 feature of jit.phys.world as in the jitter-examples phys.picker.impulse.maxpat file, i still get contact detections / sound with the videomatrix even if i put the tresh to 1.

Why is that?

Attachments:
  1. cam2sound.zip
#226520
Sep 11, 2012 at 10:35am

hi tobiasros
if your camera is 16:9 you simply adjust the scale of the mesh and videoplane.
the 100*100 matrix was just for testing….
to follow the format we could set the mesh matrix to the good ratio (100*75 for 4:3….)
-yes if you change the jit.expr * you can change the “collisions area”, but you can set “jit.expr @expr snorm[0] in[0] snorm[1]” too, and only use scale message to mesh for that.

For the sound collisions may be the z scale of falling bodies needs to be decreased…

hope it can help

#226521

You must be logged in to reply to this topic.