how to not rotate around object
3 posters
how to not rotate around object
tutorial 09
I have 2 objects: player and obj
need to obj does not rotate around the player.
How do it? Please help
Thanks!!!!!
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 );
need to obj does not rotate around the player.
How do it? Please help
Thanks!!!!!
Re: how to not rotate around object
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
Re: how to not rotate around object
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
Re: how to not rotate around object
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
Re: how to not rotate around object
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
Re: how to not rotate around object
********!!!!! uuuu
obj->_SIO2transform->_SIO2parent = object->_SIO2transform;
handle parent to child
obj->_SIO2transform->_SIO2parent = object->_SIO2transform;
handle parent to child
Re: how to not rotate around object
Check tutorial14 for more info about parenting & physic... that's might be part of what you are looking for...
Re: how to not rotate around object
sio2interactive wrote:Check tutorial14 for more info about parenting & physic... that's might be part of what you are looking for...
thanks....
Re: how to not rotate around object
sakrist wrote:sio2interactive wrote:Check tutorial14 for more info about parenting & physic... that's might be part of what you are looking for...
thanks....
- 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;
Similar topics
» rotate a physics object?
» Rotate the camera instead of the object...
» Can't rotate the Camera straight up or down
» How to rotate a object without changing the axis by SIO2?
» Camera Rotate Y
» Rotate the camera instead of the object...
» Can't rotate the Camera straight up or down
» How to rotate a object without changing the axis by SIO2?
» Camera Rotate Y
Permissions in this forum:
You cannot reply to topics in this forum