Home   Help Search Login Register  

Author Topic: Sin Cos; Left, Right, Back, Front  (Read 700 times)

0 Members and 1 Guest are viewing this topic.

RedHouse

  • Guest
Sin Cos; Left, Right, Back, Front
« on: 19 Sep 2005, 20:53:07 »
IM creating a sort of super spectateing thing so makeing movies of gameplay in multiplayer will be alot easyier

But I need to know how to find the position 5 meters to the left, right, back and front of a unit so that i can position the cam there.

I already know the code for finding the 5 meters infront and 5 meters behind but i dont know how to find the position for left and right.

Can someone help me please?

Kyle Sarnik

  • Guest
Re:Sin Cos; Left, Right, Back, Front
« Reply #1 on: 19 Sep 2005, 20:55:01 »
Simply add or subtract 90 degrees from the direction and use your trigonometric functions.

Offline RujiK

  • Members
  • *
  • KoKo Puh-Fizzles!
Re:Sin Cos; Left, Right, Back, Front
« Reply #2 on: 19 Sep 2005, 21:37:47 »
One of these is left and another is right but I forget which. But if you know how to use front and back already I'm sure you can figure it out.
The only different is instead of two minus signs or two plus signs you go with one of each.
Code: [Select]
[(getpos _unit select 0) + (sin getdir _unit*_number),(getpos _unit select 1) - (cos getdir _unit*_number),0]
Code: [Select]
[(getpos _unit select 0) - (sin getdir _unit*_number),(getpos _unit select 1) + (cos getdir _unit*_number),0]
« Last Edit: 19 Sep 2005, 21:38:41 by RujiK »
I like your approach, lets see your departure.
Download the New Flashlight Script!

RedHouse

  • Guest
Re:Sin Cos; Left, Right, Back, Front
« Reply #3 on: 19 Sep 2005, 22:39:49 »
cheers for the help dudes

*slaps himself in head* what an idiot, change degrees, im so stupid