Quantcast

Jump to content

» «
Photo

Relative Camera Position - solution

No replies to this topic
Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013

#1

Posted 31 January 2014 - 06:18 PM Edited by Michael Wojtanis, 31 January 2014 - 06:26 PM.

Hi people.

I just making little script and i wanted a Relative Camera Position - left, right...

 

GTA Native have calls for peds, objects and cars, but i did not saw any for camera.

 

So there is, left:

Vector3 camDir = Game.CurrentCamera.Direction;
Vector3 TEST = Vector3.TransformCoordinate(camDir, Matrix.RotationAxis(Vector3.WorldUp, 1.57775F));
TEST = TEST + Game.CurrentCamera.Position;

Right:


Vector3 camDir = Game.CurrentCamera.Direction;
Vector3 TEST = Vector3.TransformCoordinate(camDir, Matrix.RotationAxis(Vector3.WorldUp, -1.57775F));
TEST = TEST + Game.CurrentCamera.Position;

Back:

Vector3 camDir = Game.CurrentCamera.Direction;
Vector3 TEST = Vector3.TransformCoordinate(camDir, Matrix.RotationAxis(Vector3.WorldUp,  3.15555F));
TEST = TEST + Game.CurrentCamera.Position;

Front:

Vector3 camDir = Game.CurrentCamera.Direction;
TEST = camDir+Game.CurrentCamera.Position;

If You want bigger amount then You should multiplication the TEST where is Vector3.TransformCoordinate.

 

I think for new modders mayby that will give new ideas :)

  • hardsty1e and LordOfTheBongs like this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users