Child object - unchanged trans

View previous topic View next topic Go down

Child object - unchanged trans

Post  _-MADMAN-_ on Tue May 19, 2009 8:17 am

Hi,

I have relation:

Code:
   helper->_SIO2transform->_SIO2parent = player->_SIO2transform;
   sio2TransformBindMatrix(helper->_SIO2transform);

Everything is ok, I see how child object "fallow" the parent.

Next step - bind emitter to child object:

Code:
       d_emitter->_SIO2transform->rot->x = helper->_SIO2transform->rot->x;
      d_emitter->_SIO2transform->rot->y = helper->_SIO2transform->rot->y;
      d_emitter->_SIO2transform->rot->z = helper->_SIO2transform->rot->z;
      
      d_emitter->_SIO2transform->loc->x = helper->_SIO2transform->loc->x;
      d_emitter->_SIO2transform->loc->y = helper->_SIO2transform->loc->y;
      d_emitter->_SIO2transform->loc->z = helper->_SIO2transform->loc->z;
   }
   sio2TransformBindMatrix( d_emitter->_SIO2transform );

And nothing happend - emitter is still in 0.0.0 position. Also I see, that child object disappear while camera do not look at initial position of helper. What is wrong with my code? How can I bind actual ogl transformation to internal object?

Regards,
Mad

_-MADMAN-_

Posts : 52
Join date : 2009-04-23

View user profile

Back to top Go down

Re: Child object - unchanged trans

Post  sio2interactive on Tue May 19, 2009 2:14 pm

Check tutorial14

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
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: Child object - unchanged trans

Post  _-MADMAN-_ on Wed May 20, 2009 4:00 am

I have studied totorial 14 and still can't find solution for my problem. Child object renders properly, same as md2 object in tut14, but his transformation are equal 0 - so any object binded to child doesn't move/rotate/whatever. I'm quite confused about what is rendered and what is calculated by engine scratch Can You explain me that topic like for idiot? Laughing

_-MADMAN-_

Posts : 52
Join date : 2009-04-23

View user profile

Back to top Go down

Re: Child object - unchanged trans

Post  Don Jaffa on Wed May 20, 2009 5:37 am

I had this problem, seems to me the engine doesn't like 2 layers of parenting - solved it by parenting everything to a ghost 'parent' object (though I realize this may not be applicable for your project).

Don Jaffa

Posts : 49
Join date : 2009-02-19

View user profile

Back to top Go down

Re: Child object - unchanged trans

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