I've been working on this camera that I want to follow around 2 characters, but have it be the side view all of the time, and when the two characters get further apart, the camera gets further away. sortof like a Tekken camera, or one of those fighting games that you have full movement in.
I have it working so that the camera's focus point is the midpoint of the two characters, and I have it so that the camera zooms in and out based on the distance between the two fighters, but when i tried to code the part so that the camera will always be perpendicular to the fighters, I got lost. this is what I have so far, and for some reason, ApplyForce() does nothing to the camera thing, while SetThingVel() seems to be using world axis instead of relative axis.
I tried using VectorCross as a means of knowing if the camera is offset to the right or left, but I dont think it is working properly...Then again, it could jus be that it is making the velocity be in world axis, but I was under the impression that SetThingVel() used relative axis.
Does anyone know why applyForce won't budge the camera at all? while SetThingVel just goes crazy?
If anyone knows of an easier way to do this, it would be very helpfull
I hope t hat wasn't too confusing....
------------------
I'm just an old man with a skooma problem.
I have it working so that the camera's focus point is the midpoint of the two characters, and I have it so that the camera zooms in and out based on the distance between the two fighters, but when i tried to code the part so that the camera will always be perpendicular to the fighters, I got lost. this is what I have so far, and for some reason, ApplyForce() does nothing to the camera thing, while SetThingVel() seems to be using world axis instead of relative axis.
Code:
plook = VectorNorm(VectorSub(GetThingPos(victim), GetThingPos(player))); SetThingLook(player, plook); SetCameraFocus(0, camera); clook = VectorSub((VectorNorm(VectorAdd(GetThingPos(player), GetThingPos(victim)))), GetThingPos(camera)); SetThingLook(camera, clook); pdist = VectorDist(GetThingPos(player), GetThingPos(victim)); cdist = VectorDist(GetThingPos(camera), VectorNorm(VectorAdd(GetThingPos(player), GetThingPos(victim)))); cross = VectorCross(GetThingLVec(camera), VectorNorm(VectorSub(GetThingPos(player), GetThingPos(victim)))); SetThingVel(camera, VectorSet(VectorX(cross)*10, VectorY(GetThingLVec(camera))*(cdist-pdist)*10, 0)); Printvector(cross);
I tried using VectorCross as a means of knowing if the camera is offset to the right or left, but I dont think it is working properly...Then again, it could jus be that it is making the velocity be in world axis, but I was under the impression that SetThingVel() used relative axis.
Does anyone know why applyForce won't budge the camera at all? while SetThingVel just goes crazy?
If anyone knows of an easier way to do this, it would be very helpfull
I hope t hat wasn't too confusing....
------------------
I'm just an old man with a skooma problem.
I'm just an old man with a skooma problem.