Forums > MaxMSP

node object with nodes in other shapes than circles

Jan 08 2012 | 3:20 pm


i use a 3 axis accelerometer as a 3d pointing device. i am building a user interface where you can define areas which are triggering events if you hit them with the virtual pointer of the device.

it should be possible to draw rectangular shapes with the mouse that work as triggers.

Is it possible to give the node-circles of the node object another shape (rectangle) or is there another ui element that could be used for that?

lcd with sprites and selfmade collision detection will do the trick, but perhaps there is something re-usable…



Jan 10 2012 | 2:26 pm

Very interesting i would like to know too!

Jan 10 2012 | 7:42 pm

you can use the jit.phys objects to handle collision detection from any screen coordinates, using the "screenraytest" message to

the jit.phys.bodies can be any one of several simple shapes, combinations of simple shapes, or arbitrary shapes defined by sending a matrix of vertices to the jit.phys.body object.

the patch below shows a basic implementation using the mouse (however any input device can be used, as long as it’s mapped to screen coordinates).

please let me know if you have any questions.

-- Pasted Max Patch, click to expand. --

Jan 11 2012 | 12:50 am

I can’t wait to dig into the physics stuff! Looking forward to trying these example patches…

…but if you’re Max 6-challenged as of now…

you can do a workaround using different colors and [suckah], using any shapes you want, but you’ll see the colors. Or you can use the mouse output of jit.pwindow or jit.window, and have the mouse cursor auto-move with

;max pupdate $1 $2

You can also use [hover] and choose some rectangular objects to work with. Or maybe a gigantic [tab] with multiple rows and columns, and check the hover outlet.

even further, because you know the movements of your pointing device, you can just test for "bounds" directly with a bunch of [expr] objects for position.

Oct 17 2016 | 9:55 am

Hi Rob,

This is a great example ! I have looked through the attributes, but I can’t seem to find out how I can overlay / intersect two bodies, and get the x / y values from both bodies, whenever the mouse position is within both of them.

Do you know of a way to do that ?

All the best,

Oct 17 2016 | 10:31 am

I’m sorry, don’t know what I did different. It works out of the box with your example.

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

Forums > MaxMSP