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

Jan 3, 2013 at 10:11pm

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

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.

#65904
Jan 4, 2013 at 1:18pm

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. –
#237342
Jan 4, 2013 at 2:24pm

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

#237343
Jan 4, 2013 at 7:12pm

@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 :)

#237344
Jan 4, 2013 at 7:16pm

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.

#237345
Jan 4, 2013 at 7:35pm

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…

#237346
Jan 4, 2013 at 9:30pm

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. –
#237347
Jan 5, 2013 at 2:26pm

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

#237348
Jan 6, 2013 at 7:05pm

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?

#237349
Jan 7, 2013 at 9:20pm

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.

#237350

You must be logged in to reply to this topic.