Rotate object through global axis

View previous topic View next topic Go down

Rotate object through global axis

Post  andreassilva on Thu Feb 19, 2009 10:08 am

Hi there,

I really need to rotate an object through the global axis.
The transformation just let me rotate the object through their own axis:

Code:

object->_SIO2transform->rot->x += 90.0;
sio2TransformBindMatrix( _SIO2object->_SIO2transform );

I really apreciate if you can help me.

Thanks Smile

andreassilva

Posts : 22
Join date : 2009-02-19

View user profile

Back to top Go down

Re: Rotate object through global axis

Post  sio2interactive on Thu Feb 19, 2009 3:14 pm

Check tutorial14 to see how you can link another matrix to an SIO2transform, so you can have one matrix that move you object from the center then render it around its pivot point.

Cheers,
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: Rotate object through global axis

Post  andreassilva on Fri Feb 20, 2009 5:56 am

Thanks for reply Smile,

but I didn't get what you meant to say, i guess.

here is my code
Code:


/*SIO2object *_SIO2objectAux = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource,
                                                    SIO2_OBJECT,
                                                    "object/MatrixCube");
*/

SIO2object *_SIO2object = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource,
                                    SIO2_OBJECT,
                                    "object/Cube" );
      
//_SIO2object->_SIO2transform->_SIO2parent = _SIO2objectAux->_SIO2transform;
      
if( _SIO2object )
{
   _SIO2object->_SIO2transform->rot->x += 30.0;
}

sio2TransformBindMatrix( _SIO2object->_SIO2transform );
//sio2TransformBindMatrix( _SIO2objectAux->_SIO2transform );

As you can see, in the commentated code, I tryed to do some parent but no success..

can you give me a simple example code please?

Thank you

andreassilva

Posts : 22
Join date : 2009-02-19

View user profile

Back to top Go down

Re: Rotate object through global axis

Post  sio2interactive on Fri Feb 20, 2009 7:09 am

Code:


      sio2TransformBindMatrix( _SIO2md2->_SIO2transform );
   
      // Create a parent child relationship between the
      // SIO2md2 and the SIO2object transformation used for collision.
      _SIO2md2->_SIO2transform->_SIO2parent = sio2ResourceGetObject( sio2->_SIO2resource,
                                                     "object/yoshi" )->_SIO2transform;
   

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: Rotate object through global axis

Post  andreassilva on Fri Feb 20, 2009 7:34 am

Well, that was what I concluded before (that's in the commentated code).

I need you to be more specific please:
-What to do in blender?
-Which object to rotate?
-Dont want to use md2 of course.

(btw, the code is in the Render function)

Thanks

andreassilva

Posts : 22
Join date : 2009-02-19

View user profile

Back to top Go down

Re: Rotate object through global axis

Post  andreassilva on Wed Feb 25, 2009 2:11 am

I need some help here please

andreassilva

Posts : 22
Join date : 2009-02-19

View user profile

Back to top Go down

Re: Rotate object through global axis

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