jit.anim.path has no matrixcalc function; any howto?

May 14, 2012 at 7:10pm

jit.anim.path has no matrixcalc function; any howto?

jit.anim.path has no matrixcalc function, how do i get the values of its output and deliver it to the jit.anim.node? is there a hidden listener/callback pair to get the values?

#63593
May 14, 2012 at 10:05pm

hi, thanks much for pointing this out.
it looks like js support for jit.anim.path is currently lacking.
i will get this fixed for a future update.
my apologies for this oversite.

in the meantime, your only option is to leave the jit.anim.path object outside of the js.
if you set the @drawto attribute to the opengl drawing context, the jit.anim.path object will automatically output it’s values (position, scale, quat) out it’s first outlet, when the animation is enabled (@play 1).

you can plug this into a js object if desired, and create function handlers for the values.
below is a basic patch and basic js.
if this doesn’t help you, please let me know more about what you are trying to do, and perhaps i can offer a better suggestion (other than waiting for the next update).

var gshape = new JitterObject(“jit.gl.gridshape”,”pathjs”);
gshape.shape=”torus”;
gshape.scale=[0.2, 0.2, 0.2];

function position(args) {
gshape.position=[arguments[0],arguments[1],arguments[2]];
}

– Pasted Max Patch, click to expand. –
#229213
May 15, 2012 at 6:55pm

thanks for answering, thats what i want to realize:

i want to create a helix of cubes (about 100). the helix spline should be the rail/slide for the cubes. every cube should have its own animation path for its way down the slide. the stop point (end of anim.path) varies because every cube should lay on the previous cube (like a stack of cubes in helix shape).

i have no other idea, to realize this without anim.path.

#229214
May 16, 2012 at 3:37pm

so, i did it like you described and it works…

but, when i switch to fullscreen the rendering process stops, dont know why. Is this a missing feature too?

Attachments:
  1. dnaspline.zip
#229215
May 16, 2012 at 10:16pm

thanks for the patch.

yeah there’s some tricky things going on here. the main issue is that the fullscreen message causes the render context to be recreated, which causes the animation objects to be removed. in normal use, they will get immediately re-added, but this is not happening in your case.

for now, i would recommend instead of using the fullscreen message, use the @size or @rect attributes of jit.window, to go fullscreen. you can hide the menubar with the max messages “hidemenubar” and “showmenubar”.

alternatively, you can re-send all the anim.path objects the drawto message with the name of your context, after going fullscreen.

i’ll work on getting this sorted out for a future update.

#229216
May 17, 2012 at 10:09am

this sounds like the garbage collector (if there is any) throws away the matrix while switching modes. maybe i should resend the matrix for anim.path after switching modes? do you think this would help?

there is an other thing in this patch. the setting of the direction produces strange artifacts at some positions of the path. it looks like the renderer does not know if it should render the back or the front side of the cube. strange flicker and triangles… I calculate the direction like in the example patch with the plane (model.anim.node.simple.maxpat) vexpr $f1-$f2

#229217
May 17, 2012 at 10:33am

ahh ok, i didn’t read well. resend the drawto and resending the matrix does not work, i’ll try recreate the whole abstraction as a clone or so

#229218
May 17, 2012 at 11:32am

drawto works, i was wrong, thanks

do you have an idea with these artifacts?

[attachment=193996,3883]

Attachments:
  1. Untitled1.png
#229219

You must be logged in to reply to this topic.