Reply to comment

ltmon's picture

It's called trigonometry people....

In 2d (ignoring z axis)

tan((4-2)/(8-4)) = theta

theta = 0.463647 Radians

In 2d (ignoring y axis)

tan((2-1)/(8-4)) = theta

theta = 0.2444978

Converting to degrees, you would have to be holding the gun a horizontal polar rotation of 26.5 degrees leftwards in relation to the x axis, and vertical polar rotation 14 degrees upwards in relation to the x axis(plus or minus a few decimal points).

Of course this is using standard coordinates, but games usually run the y axis from top-to-bottom, rather than bottom-to-top, so you might have to hold the gun 26.5 degrees to the right, not the left.

Reply

The content of this field is kept private and will not be shown publicly.
  • Project issue numbers (ex. [#12345]) turn into links automatically.
  • You can use Textile markup to format text.
  • Lines and paragraphs break automatically.
  • Insert Flickr images: [flickr-photo:id=230452326,size=s] or [flickr-photoset:id=72157594262419167,size=m].
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may use [view:name=display=args] tags to display views.
  • Avast! This website be taken over by pirates on September 19th. Yarr!

More information about formatting options

CAPTCHA
This question is for testing whether you are a Norwegian and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.