Questions tagged [trigonometry]

A branch of mathematics that studies triangles and the relationships between their sides and the angles between these sides.

Filter by
Sorted by
Tagged with
13
votes
2answers
15k views

How do I generate projectiles toward the mouse pointer? [duplicate]

I'm making a top-down space shooter where the player controls a ship and can aim and shoot using the mouse cursor. How can I fire bullets from the ship at the angle from the ship to the mouse cursor?
1
vote
2answers
940 views

How can I correct an unwanted fisheye effect when drawing a scene with raycasting?

Hello I have a game using raycasting for the TI Nspire in Lua, and when the player faces a wall so that their degree they are facing is perpendicular to the length of the wall, I am having what is ...
6
votes
1answer
7k views

Raycasting “fisheye effect” question

Continuing my exploration of raycasting, I am very confused about how the correction of the fisheye effect works. Looking at the screenshot below from the tutorial at permadi.com, the way I ...
14
votes
3answers
21k views

How do I make an entity move in a direction?

I have an Entity instance which is updated every game tick. Let's just assume that entity moves forward constantly. I'd like to be able to give the entity's angle ...
7
votes
1answer
3k views

Spherical to Cartesian Coordinates

Well I'm reading the Frank's Luna DirectX10 book and, while I'm trying to understand the first demo, I found something that's not very clear at least for me. In the updateScene method, when I press A, ...
3
votes
1answer
771 views

determine collision angle on a rotating body

update: new diagram and updated description I have a contact listener set up to try and determine the side that a collision happened at relative to the a bodies rotation. One way to solve this is to ...
3
votes
3answers
3k views

breakout game, computing optimal ricochet angle of a ball to get to a certain point

perhaps the title isn't clear so here is an explanation with a picture to better express my question Consider the following breakout clone game where the game is rigged to change the ricochet angle ...
0
votes
1answer
500 views

Unity Mathf.Atan2 algorithm complexity

using Unity5.5.1f; using C#; So I have a circle (2D) divided equally by 16 directions, and I also have a direction V which is different from the other 16. In order to know which direction is the ...
0
votes
0answers
77 views

How to find optimal perpendicular axis of rotation vector to draw arrows?

I am drawing lines on the screen. Each line has a point (x,y,z) and a direction (u,v,w). I want to draw arrow heads on these ...
0
votes
2answers
102 views

How to panning camera on XZ axis with different angles

I have an Orthographic camera where the position is { x:0, y:100, z:0 } and is pointing/looking at { x:0, y:0, z:0 }. At this ...