Camera alignment changes although no change was done

View previous topic View next topic Go down

Camera alignment changes although no change was done

Post  AstAn on Tue Sep 15, 2009 4:40 pm

I load a camera from my package. The camera in the package has a rotation. When I now call sio2TransformBindMatrix on the camera's transform the orientation of the camera in the engine changes. I am not completely sure what happens but the object which was previously in front of the camera is no longer visible. Can someone explain to me or give me a hint what goes wrong?

AstAn

Posts : 12
Join date : 2009-08-22

View user profile

Back to top Go down

Re: Camera alignment changes although no change was done

Post  sio2interactive on Tue Sep 15, 2009 5:07 pm

You need to change the direction, not the rotation... or simply use sio2LookAt...

_________________
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: Camera alignment changes although no change was done

Post  AstAn on Wed Sep 16, 2009 1:06 am

My point is that I do not change anything at all, just call sio2TransformBindMatrix on the transformation.
So is sio2TransformBindMatrix the wrong function then? Does the camera update itself automatically during the render and frustum functions that I call for it?

AstAn

Posts : 12
Join date : 2009-08-22

View user profile

Back to top Go down

Re: Camera alignment changes although no change was done

Post  mordenkaim on Wed Sep 16, 2009 5:29 am

Yes. Generally you don't have to call SIO2TransformBindMatrix for a camera object. sio2->_SIO2camera->_SIO2transform->loc->x will move it without a call to SIO2TransformBindMatrix.

mordenkaim

Posts : 21
Join date : 2009-05-19

View user profile

Back to top Go down

Re: Camera alignment changes although no change was done

Post  AstAn on Wed Sep 16, 2009 2:38 pm

Thanks, it is working now but not completely as expected.

When I rotate the camera around the object horizontally, everything is fine. When I do it vertically, the object starts to move into the distance. The distance of the camera towards the object is always the same so it must have something to do with the camera's projection. I was wondering where the up vector of the camera is stored. Maybe this is what causes the problem.

AstAn

Posts : 12
Join date : 2009-08-22

View user profile

Back to top Go down

Re: Camera alignment changes although no change was done

Post  sio2interactive on Wed Sep 16, 2009 5:06 pm

Just use sio2LookAt...

_________________
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: Camera alignment changes although no change was done

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