Forums > Jitter

any way to cheat spline interpmode to circular-like of jit.anim.path ?

January 3, 2013 | 10:11 pm

Hi there,
I need to create a circular movement of a jit.gl.cam around a static point.
jit.anim.path is perfect for this purpose.

how would I handle this using spline and a reasonable number of points in the path ?

subsidiary question: would I use jit.anim.path to keep the cam to look at the same point all along the movement ?

huge thanks for any leads.


January 4, 2013 | 1:18 pm

I would just use a pair of sin / cos functions to build a circular shape and to drive the camera… and a fixed lookat position.
If you want to really use jit.anim.path, i guess you could feed this position data to add points in jit.anim.path…

– Pasted Max Patch, click to expand. –

January 4, 2013 | 2:24 pm

I don’t know which one would be the most cpu consuming.
sin/cos usually consumes but in Max, I guess they involve some lookup tables or like.
moving the cam, I don’t achieve to fix the lookat. I mean, if I move the cam, the lookat attributes don’t change BUT in fact, the cam doesn’t look at the right point. (I’ll play with other parameter like tripod etc.. I don’t know)

Using 8 points distributed on a circle, I did that using jit.anim.path
at each point I set up the setrotatexyz and that seems to work fine


January 4, 2013 | 7:12 pm

@pedro, I finally implemented cos/sin as it comes more natural.
I need to make the speed of rotation variable.
I’ll probably increase the resolution of the [counter] and use some [line] wizardry :)


January 4, 2013 | 7:16 pm

use the locklook attribute to lock the camera’s lookat point.

i would simply feed the circle points to a jit.anim.path, and control the speed using the rate attribute.


January 4, 2013 | 7:35 pm

Hi robert and thanks for your answer.
got it for locking lookat.
about the jit.anim.path, I guess I should append my points list with a reasonable number of points and use spline interp.
testing that…


January 4, 2013 | 9:30 pm

Rob showed me how to use matrix input to anim.path. This way you can generate the points with a jit.expr or jit.gen:

– Pasted Max Patch, click to expand. –

January 5, 2013 | 2:26 pm

This works fine! THANKS.
Doing that with jit.gen and playing with a variable path radius.


January 6, 2013 | 7:05 pm

How do you control the spline interp? Or are there some kind of "bezier points" to control its curvature, or at least a parameter to control its width?


January 7, 2013 | 9:20 pm

the spline in jit.path (and anim.path and gl.path) is automatically generated using the Catmull-Rom method.
you can adjust the curve by editing these default handle values.
take a look at the gethandle and edithandle messages, and take a look at the "editing" tab of the jit.path help file.
remember to disable @autohandles if you plan to edit your handle values.


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