3d animation as sequence of rotations / quaternions

edited October 2015 in How To...

hi everybody,

i have a 3d object and i want to animate it. the animation should consist of a sequence of rotations. first the object has orientation o1. then it smoothly (interpolation) changes its orientation to o2 and so on.

what's the best way to do that in that processing? thanks.

Answers

  • Hey,

    lerp() is a function that can help you to interpolate between two values.

    I don' know what you have so far but it could look similiar to this:

    rotateY( lerp( o1, o2, amount) );

    Where 'amount' could depend on frameCount, millis(), mouseX or whatever you want.

  • edited October 2015

    Thanks, but that is not solving my Problem.

    As far as my research goes i have to use quaternions. But i do not know how. Which implementation should i use? How do i use quaternions with the rotate-functions processing offers? How do i interpolate between several quaternions to have a smooth animation between several orientations?

This discussion has been closed.