Hey
Is there any function in cocos2d like gluLookAt?
I want to change my camera position every frame, how can I do it?
A fast, easy to use, free, and community supported 2D game engine
Hey
Is there any function in cocos2d like gluLookAt?
I want to change my camera position every frame, how can I do it?
I use this.
[self.camera setEyeX:X eyeY:Y eyeZ:Z];
mm..thanks.
When should I call this function?
i do it every frame inside my step
Hey, thats what I do every frame:
[self.camera setEyeX:100 eyeY:-300 eyeZ:-1];
[self.camera setCenterX:100 centerY:-300 centerZ:0];
[self.camera setUpX:0 upY:1 upZ:0];
Everything works fine, but there is one small problem. My scene is now flipped horizontaly.
It looks like negative side of the coordinate system is on the right, and positive numbers are on the left.
that because you have negative z in your eyeZ.
instead of setting it to '-1' to a positive number.
I'm not sure what it is by default but use self.camera->eyeZ to keep it the same.
Thanks a lot :)
You must log in to post.