Emulating jit.gl.handle autorotate ?
Hi All,
I'm messing with a patch that does the video on a cube effect.
Working from the tutorial, I see how to get the cube to spin using jit.gl.handle with auto_rotate set to 1 and using the mouse to nudge the cube.
I'm wondering , is there any way to emulate this nudge so that I can send maybe a sequence of a few rotate commands to the jit.gl.handle object to get it started, then the cube will continue to rotate?
I want to start the rotation in software, but have it continue using autorotate. The point is that I wouldn't have to continually control the rotation thru software.. just give it a nudge but without having to use the mouse.
In this way I could have a small set of several "nudge" commands that could be triggered periodically to make the cube spin in different ways without having to use the mouse to achieve it, and without having to run a continuous calculation to control the rotation.
any ideas?
Thanks so much!
- Valentin
you can try something like this:
On 12 Jun 2008, at 19:19, Valentin wrote:
>
> Hi All,
>
> I'm messing with a patch that does the video on a cube effect.
>
> Working from the tutorial, I see how to get the cube to spin using
> jit.gl.handle with auto_rotate set to 1 and using the mouse to
> nudge the cube.
>
> I'm wondering , is there any way to emulate this nudge so that I
> can send maybe a sequence of a few rotate commands to the
> jit.gl.handle object to get it started, then the cube will continue
> to rotate?
>
> I want to start the rotation in software, but have it continue
> using autorotate. The point is that I wouldn't have to continually
> control the rotation thru software.. just give it a nudge but
> without having to use the mouse.
>
> In this way I could have a small set of several "nudge" commands
> that could be triggered periodically to make the cube spin in
> different ways without having to use the mouse to achieve it, and
> without having to run a continuous calculation to control the
> rotation.
>
> any ideas?
>
> Thanks so much!
>
> - Valentin
Probably a counter or line object to a rotatexyz command for the jit.gl.render (to do the scene itself) or to the jit.gl.gridshape (to do just the cube). I don't think you can start the handle commands without the mouse, but I'm not sure. If you print out the output of handle you'll see it's a continuous calculation of rotate, plus position and scale when these are used (modifier keys). I personally have a hard time grasping the format of the rotate commands, but rotatexyz makes sense (0-360 in three axes). Just use some counters or lines to get that shape revved up and spinning in any way you want.
Also you might put a gate between the "erase" command to jit.gl.render. This (on some machines anyway) causes interesting "trails" as the shape moves or rotates, since it's not erased each time. Set jit.gl.handle to visible 0 to get rid of the round axes if you want.
Try various wireframe or points settings (polymode 0 0 or 1 1 or 2 2) for the gridshape---some of these look pretty cool with the video textured on them, as opposed to the traditional solid form. Also you can then change the dimensions of the shape, the line width, and the point size, and see the results---very nice!
--CJ
Thanks for both replies :-)
The example patch works perfectly. I also tried the wireframe and points settings to go along with the video - def. cool looking.
Sweeet.
Extremely helpful patch Brecht, thank you!
+1
Extremely helpful patch Brecht, thank you!