auto rotation

View previous topic View next topic Go down

auto rotation

Post  rajvikram on 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

View user profile

Back to top Go down

Re: auto rotation

Post  meteors on 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
avatar
meteors

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

View user profile

Back to top Go down

Re: auto rotation

Post  sio2interactive on 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.
avatar
sio2interactive

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

View user profile http://sio2interactive.com

Back to top Go down

Re: auto rotation

Post  rajvikram on 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

View user profile

Back to top Go down

Re: auto rotation

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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