InterpolateCameraPos - Help?
#1

[ame]http://www.youtube.com/watch?v=8nLOAJrr3lA[/ame]
Код:
GetPlayerPos(criminal, Pos[0], Pos[1], Pos[2]);
SetPlayerCameraLookAt(criminal, Pos[0], Pos[1], Pos[2], CAMERA_CUT);
InterpolateCameraPos(criminal, Pos[0], Pos[1], Pos[2], Pos[0] + 20, Pos[1] + 15, Pos[2] + 15, 4500);
Yet, the camera don't face / look down to the player.
Reply
#2

Don't use SetPlayerCameraLookAt.. That way, you'll be only changing "LookAt" once. Not continuously when the camera moves.

Try to add:
"InterpolateCameraLookAt" (also, make it slower than "interpolatepos"...)
Reply
#3

Why not? Even if I used:

InterpolateCameraLookAt - The old x,y,z and the new x,y,z would be the same as the x,y,z's are the player x,y,z.
Reply
#4

Quote:
Originally Posted by KyleSmith
Посмотреть сообщение
Why not? Even if I used:

InterpolateCameraLookAt - The old x,y,z and the new x,y,z would be the same as the x,y,z's are the player x,y,z.
What the.... did you meant there? just use InterPolateCameraLookAt, it got add for a purpose + works for me.
Reply
#5

SetPlayerCameraLookAt works fine for me, I used a similar setup when making a shockwave camera.
Reply
#6

Quote:
Originally Posted by KyleSmith
Посмотреть сообщение
Why not? Even if I used:

InterpolateCameraLookAt - The old x,y,z and the new x,y,z would be the same as the x,y,z's are the player x,y,z.
The camera's point of view will still change when you use InterpolateCameraPos after SetPlayerCameraLookAt.

In that case, you need to have something that'll keep the point of view in place, right?

What my untested solution is, to use InterpolateCameraLookAt after the Pos function with a bit slower time and a little offset.
So, the LookAt interpolation will keep changing the lookat until it reaches the point..
Reply
#7

When the camera starts moving, you have to set the camera facing to the point where the player will be after the camera movement stopped.
So if you move the camera by 20.0 15.0 and 15.0 on the X, Y and Z axis, you have to make the camera face to the player's position minus the camera movement offset. In this case it should be PlayerposX - 20.0, PlayerposY - 15.0 and PlayerposZ - 15.0
If I'm not mistaken, you should end up with this:
pawn Код:
GetPlayerPos(criminal, Pos[0], Pos[1], Pos[2]);
InterpolateCameraPos(criminal, Pos[0], Pos[1], Pos[2], Pos[0] + 20, Pos[1] + 15, Pos[2] + 15, 4500);
SetPlayerCameraLookAt(criminal, Pos[0] - 20, Pos[1] - 15, Pos[2] - 15, CAMERA_CUT);
Reply
#8

Thanks, but how can I bring it closer:



Код:
GetPlayerPos(criminal, Pos[0], Pos[1], Pos[2]);
InterpolateCameraPos(criminal, Pos[0], Pos[1], Pos[2], Pos[0] + 20, Pos[1] + 15, Pos[2] + 8, 4500);
InterpolateCameraLookAt(criminal, Pos[0] - 20, Pos[1] - 20, Pos[2] - 20, Pos[0] - 20, Pos[1] - 20, Pos[2] - 20, 500, CAMERA_MOVE);
Reply
#9

Try this:
pawn Код:
InterpolateCameraLookAt(criminal, Pos[0], Pos[1], Pos[2] - 30, Pos[0], Pos[1], Pos[2], 5000, CAMERA_MOVE);
//or:
InterpolateCameraLookAt(criminal, Pos[0], Pos[1], Pos[2] - 30, Pos[0], Pos[1], Pos[2], 4600);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)