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.

how to not rotate around object

3 posters

Go down

how to not rotate around object Empty how to not rotate around object

Post  sakrist Thu May 28, 2009 1:24 pm

tutorial 09

I have 2 objects: player and obj


Code:

SIO2object *object = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource,
                                                  SIO2_OBJECT,
                                                  "object/player" );
         
         
         ....
         code for player
         ....
         
         SIO2object * obj = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource,
                                              SIO2_OBJECT,
                                              "object/obj" );

         obj->_SIO2transform->loc->x = object->_SIO2transform->loc->x ;
         obj->_SIO2transform->loc->y = object->_SIO2transform->loc->y + object->dim->y + 1.5;
         obj->_SIO2transform->loc->z = object->_SIO2transform->loc->z;

         obj->_SIO2transform->rot->z = ROTZ;
         
         
         sio2TransformBindMatrix(obj->_SIO2transform);

         obj->_btRigidBody->getWorldTransform().setFromOpenGLMatrix( obj->_SIO2transform->mat );

how to not rotate around object Pictur11

need to obj does not rotate around the player.

How do it? Please help Smile

Thanks!!!!! flower
sakrist
sakrist

Posts : 23
Join date : 2009-04-28
Age : 36

http://www.developers-life.com

Back to top Go down

how to not rotate around object Empty Re: how to not rotate around object

Post  oioioi Thu May 28, 2009 1:29 pm

You can calculate it using sin and cos. If you don't want to do the math your self you can look on sio2Rotate3d function(used in tutorial 9)

oioioi

Posts : 136
Join date : 2008-12-02
Location : Norway

Back to top Go down

how to not rotate around object Empty Re: how to not rotate around object

Post  sakrist Thu May 28, 2009 1:50 pm

oioioi wrote:You can calculate it using sin and cos. If you don't want to do the math your self you can look on sio2Rotate3d function(used in tutorial 9)

what you mean?

now me obj rotate around player, i need it does not rotate around player and it was behind
sakrist
sakrist

Posts : 23
Join date : 2009-04-28
Age : 36

http://www.developers-life.com

Back to top Go down

how to not rotate around object Empty Re: how to not rotate around object

Post  oioioi Thu May 28, 2009 2:01 pm

Do you want the object to rotate around it origin? Then you select your object in blender and press "center new" or what ever it is, just watch one of the tutorials if you can find it, now it should work modifying the object->_SIO2transform->rot vector. I thought you wanted the object to rotate around your player

oioioi

Posts : 136
Join date : 2008-12-02
Location : Norway

Back to top Go down

how to not rotate around object Empty Re: how to not rotate around object

Post  sakrist Thu May 28, 2009 2:26 pm

oioioi wrote:Do you want the object to rotate around it origin? Then you select your object in blender and press "center new" or what ever it is, just watch one of the tutorials if you can find it, now it should work modifying the object->_SIO2transform->rot vector. I thought you wanted the object to rotate around your player

thanks

i did it, but when i move my player left or right my obj rotate around player Sad
sakrist
sakrist

Posts : 23
Join date : 2009-04-28
Age : 36

http://www.developers-life.com

Back to top Go down

how to not rotate around object Empty Re: how to not rotate around object

Post  sakrist Fri May 29, 2009 9:56 pm

********!!!!! uuuu

obj->_SIO2transform->_SIO2parent = object->_SIO2transform;

handle parent to child

Twisted Evil
sakrist
sakrist

Posts : 23
Join date : 2009-04-28
Age : 36

http://www.developers-life.com

Back to top Go down

how to not rotate around object Empty Re: how to not rotate around object

Post  sio2interactive Fri May 29, 2009 10:10 pm

Check tutorial14 for more info about parenting & physic... that's might be part of what you are looking for... Wink
sio2interactive
sio2interactive

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

http://sio2interactive.com

Back to top Go down

how to not rotate around object Empty Re: how to not rotate around object

Post  sakrist Fri May 29, 2009 10:39 pm

sio2interactive wrote:Check tutorial14 for more info about parenting & physic... that's might be part of what you are looking for... Wink


thanks....
sakrist
sakrist

Posts : 23
Join date : 2009-04-28
Age : 36

http://www.developers-life.com

Back to top Go down

how to not rotate around object Empty Re: how to not rotate around object

Post  sakrist Sun May 31, 2009 5:01 am

sakrist wrote:
sio2interactive wrote:Check tutorial14 for more info about parenting & physic... that's might be part of what you are looking for... Wink


thanks....

lol!

Code:
SIO2object *parent = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource,
                                    SIO2_OBJECT,
                                    "name parent" );
SIO2object *child = ( SIO2object * )sio2ResourceGet( sio2->_SIO2resource,
                                    SIO2_OBJECT,
                                    "name child" );
 
child->_SIO2transform->_SIO2parent = parent->_SIO2transform;
sakrist
sakrist

Posts : 23
Join date : 2009-04-28
Age : 36

http://www.developers-life.com

Back to top Go down

how to not rotate around object Empty Re: how to not rotate around object

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