I have a camera, this camera will always point to a entity, but it needs to be moveable in a circle around the entity, like the basic game camera, that points to CJ and when you move the mouse the camera rotates around the player.
What I did works well only when I have just the movement in Left\Right, when I add the Up\Down things start to be imprecise\buggy
What I've done so far:
| CODE |
:UpdateCamera // Move in XY Axis 0656: get_angle 10@ absolute_degrees_to 0@ // Angle in the circle to rotate
02F6: 1@ = sine 0@ 006B: 1@ *= CircleRadius 1@ += XCircleCenter 0087: 2@ = 1@
02F7: 1@ = cosine 0@ 006B: 1@ *= CircleRadius 1@ += YCircleCenter 0087: 3@ = 1@
// Move in XZ Axis (Buggy) - Comment this and the camera works perfectly, but only in Left\Right // { 0656: get_angle 11@ absolute_degrees_to 0@
02F6: 1@ = sine 0@ 006B: 1@ *= CircleRadius 005B: 1@ += 2@ 0087: 2@ = 1@
02F7: 1@ = cosine 0@ 006B: 1@ *= CircleRadius 1@ += ZCircleCenter 0087: 4@ = 1@ // }
//...... 015F: set_camera_position 2@ 3@ 4@ rotation 0.0 0.0 0.0 0160: set_camera_point_at XCircleCenter YCircleCenter ZCircleCenter mode 2 return |
Of course there's a piece of code where I handle the mouse movement... Mouse movement in X Axis I add + to 10@, Mouse movement in Y Axis I add + to 11@.
So... What I'm doing wrong?
This post has been edited by Link2012 on Tuesday, Sep 4 2012, 13:55