FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

auto rotation

3 posters

Go down

auto rotation Empty auto rotation

Post  rajvikram Sun Feb 15, 2009 2:44 am

Hi ..
I'm trying to achieve a simple effect with an exported blender object where I want it to rotate about an axis (simple animation). I've tried using a simple thread to update the rotation parameters every few millisecs and it seems to hang the code. Is there any other way to do it ?

thanks in advance

rajvikram

Posts : 4
Join date : 2009-01-10

Back to top Go down

auto rotation Empty Re: auto rotation

Post  meteors Sun Feb 15, 2009 8:33 am

Put this right after your call to sio2ResourceRender:

my_object->_SIO2transform->rot->x += 2.0;
sio2TransformBindMatrix( my_object->_SIO2transform );

(where my_object is the name of your object and x is the axis to rotate on)


Best,
-j
meteors
meteors

Posts : 241
Join date : 2008-11-08
Location : Sunny Florida

Back to top Go down

auto rotation Empty Re: auto rotation

Post  sio2interactive Sun Feb 15, 2009 5:09 pm

Actually it should be called before, so you'll get the current rotation for the frame, putting it after will cause the rotation to be affected the next frame. That might cause problem if you are using physic or other time critical / variable critical operations.
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

auto rotation Empty Re: auto rotation

Post  rajvikram Tue Feb 17, 2009 12:08 am

Awesome ... that worked great !! I just made a small mod to your suggestion .. same concept

_SIO2object->rot->x += 2.0;
sio2ObjectBindMatrix( _SIO2object);

rajvikram

Posts : 4
Join date : 2009-01-10

Back to top Go down

auto rotation Empty Re: auto rotation

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum