Forums > Jitter

how to animate jit.gl.camera with jit.anim.node

May 5, 2012 | 10:50 am

Hi
I am trying to animate a camera in spherical coordinates:

azimuth angle
polar angle
and distance from center to look at.

plus, very importantly, I need to be able to control the roll (tilt) of the camera. the following patch illustrates this with the help of a sphere in the center and a box that moves where the camera should be.

– Pasted Max Patch, click to expand. –

now if I apply this jit.anim.node objects to a jit.gl.camera object, it doesnt work at all!

I have been able to create an alternative patch that does it in an oldfashioned way:

– Pasted Max Patch, click to expand. –

put here I cannot control the roll(tilt)-angle (at least my linear algebra abilities fail me here) and the jit.anim.node would be a far more elegant solution.

Has anybody an idea?

cheers – martin


May 7, 2012 | 7:34 pm

hi martin.
this is currently a limitation of anim.node and gl.camera. (an anim.node attached to a gl.camera cannot be a child of another anim.node).

we are hoping to have this fixed in a future update.
in the meantime, you can achieve this in the following manner.
let me know if anything is unclear in the patch below.

– Pasted Max Patch, click to expand. –

May 9, 2012 | 1:20 pm

Hi Robert

Thank you for this solution. I will change my patch now accordingly. I circumvented this limitation in turning the complete scene around the camera, which was sitting like a lame duke in the center of the universe while everything was turning around itself. But I prefer your solution because its less mindwrapping.

I noticed there are a couple of get-messages that are not documented, like

"gettransform",
"getrotatexyz",
"getrotate",
"getposition",

etc.

It would be very helpfull to document these messages as well :-)

marvelous product anyway, and fantastic new objects, its blowing my mind with possibilities.

cheers

martin


May 9, 2012 | 5:36 pm

those messages you mention are actually documented attributes. to query the value of any attribute, you simply put get at the front of it. check out this page for more info:

http://cycling74.com/docs/max6/dynamic/c74_docs.html#jitterwhatareattributes

glad the alternate solution is working for you.


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