[sharing] 3D Camera Movements in Max 6

Dec 16, 2011 at 9:50pm

[sharing] 3D Camera Movements in Max 6

I came up with this really simple patch that shows how to use jit.anim.drive to make really smooth, totally nice-looking 3D camera movements in Jitter, with easing and everything. As a bonus, I also included a little subpatch that connects to a Space Navigator mouse. Now, go create some galaxies to explore!

– Pasted Max Patch, click to expand. –
Dec 18, 2011 at 2:29am

nice, can’t wait for your gen recipes :)

Dec 18, 2011 at 8:38pm

thank you Andrew!!!

Dec 25, 2011 at 4:28pm

Hello Andrew,

First i want to thank for this wonderfull example !

But i have a litte problem:
I am trying to stare and recall different views of the camera.
I am grabbing the position and the rotatxyz attributes.

But the stored and the recalled views are not the same.

Is there an other attribute as position and rotatxyz, which
is set, when moving the camera with “move” and “turn” ?

Thanks for any help,

here is my example patch:

– Pasted Max Patch, click to expand. –
Dec 27, 2011 at 6:23pm

hi timtom. the views are the same. it’s just that every time you bang your preset, it is causing the scene to be randomly regenerated, because your preset is including the main toggle that triggers the scene randomization.

Dec 28, 2011 at 6:24pm

thank you very much for looking into the patch robert.
now it works !

one little thing is not clear from my point of view.

the pattr oblect, which is bind to the rotatexyz attribute of the camera
is not outputting the attribute if you change it with the mouse
(using the jit.anim.drive)

also the cameras attrui object does not update.

here is a smal example:

– Pasted Max Patch, click to expand. –
Dec 31, 2011 at 9:50am

hi andrew – is there any way to set limits on an axis of camera rotation? – I’d like to be able stop the camera from looking too far up or down.

Dec 31, 2011 at 6:02pm

i am considering adding limits as a feature to jit.anim.node, so your request is registered.

in the meantime, you can to this yourself simply by keeping track for the current camera x and y rotation, and not allowing additional rotations when you’ve reached your limits.

the example patch Max6/examples/jitter-examples/render/anim/anim.camera.advanced.maxpat
give one way to do this in the “limit-orient” sub-patch.

Dec 31, 2011 at 11:50pm

Robert – thanks, but unfortunately the anim.camera.advanced.maxpat example you gave uses mouse movement as input, unlike Andrew’s example, which uses jit.anim.drive, and so it’s not at all obvious how the ‘limit-orient’ sub-patch could be repurposed for jit.anim.drive — since jit.anim.drive has to be connected directly to the object/node that it’s controlling.

Jan 4, 2012 at 5:55pm

actually, jit.anim.drive does not need to be directly connected.
it simply outputs animation messages (anim_turn, anim_move, anim_grow).

however, note that the fourth argument to the animation message is speed, and needs to be multiplied with the first three args for proper scaling of the animation.

you can set the @targetname attribute manually, and bypass the need for direct connections.

but yes, i agree limit attributes would be useful.

Jan 4, 2012 at 6:45pm

by god – it actually works – a bit of a hiccup now and then, but it works!

thanks Robert!

– Pasted Max Patch, click to expand. –
Jan 4, 2012 at 8:03pm

although I just realized I left out the fourth speed argument, and when I put it back in, the limits don’t work correctly any more – what am I doing wrong?

– Pasted Max Patch, click to expand. –
Feb 3, 2012 at 1:17am

okay, so I tried this and it worked alright, but for some reason my SpaceNavigator setup is vastly different – “hi” reports different indexes for the values, and even the device name is different on mine.

If others are having the same problem, here’s my edit of the innards of the space navigator subpatch:

– Pasted Max Patch, click to expand. –

Also worth noting: I’ve added change filtering and switched some polarities on the controls, so navigation is very different – and to me a bit more intuitive. I had the same issues with the original aka.spacenavigator and the jit.gl.handle version of it, too.


You must be logged in to reply to this topic.