Tagged Questions

The tag has no usage guidance.

3k views

Why are radians preferred over degrees in game development?

I've been looking up the definition of radians and found out that mathematicians prefer them because they are derived from pi instead of being completely arbitrary like degrees. However, I have not ...
10k views

What is the view perspective angle of most 2.5D isometric games [closed]

I examined several quite popular games to determine what perspective angle they are using. For the purpose I created a grid that is 45 and 60 degrees isometric viewed and put it onto a screenshot (of ...
13k views

Comparing angles and working out the difference

I want to compare angles and get an idea of the distance between them. For this application, I'm working in degrees, but it would also work for radians and grads. The problem with angles is that they ...
259 views

How can I launch a GameObject at a target if I am given everything except for its launch angle?

I have been working on this one for a few weeks, and I have yet to succeed. I have searched every resource out there, and tried them all, but still without success, so I do not believe existing links ...
3k views

Perfect FPS camera angle

I am making a multiplayer FPS and I am in search of some helpful tips on the perfect FPS camera angle. Because it is a multiplayer, I am making a full body model holding the gun, I find, however, that ...
13k views

How to extract euler angles from transformation matrix?

I have a simple realisation of entity/component game engine. Transform component have methods to set local position, local rotation, global position and global rotation. If transform is being set new ...
418 views

Getting an angle in degrees from north

This may have been asked already, but I was unable to find it, because I don't really know what I'm looking for. I drew a picture: I need theta. I've seen various solutions using Vector.Dot, and ...
2k views

Given an angle for an arrow, how do I find its X and Y velocities?

I want to fire an arrow toward the mouse location. X0 = the players X location X1 = the mouse X location Y0 = the players Y location Y1 = the mouse Y location I want to make a method which takes ...
2k views

Isometric view : what is the right angle to use?

Wikipedia states in an isometric view, all angles must be equal to 120. I am building my assets by making screenshots of some 3D models, so I can get any point of view on them. I tried to capture ...
510 views

Calculating the correct particle angle in an outwards explosion

I'm creating a simple particle explosion but am stuck in finding the correct angle to rotate my particle. The effect I'm going for is similar to this: Where each particle is going outwards from the ...
9k views

How do I find a point given an angle and distance to it?

I'm working on a school project creating a tank team in the programming game Robocode. (It's a tank battle game with self-programmed bots, in Java). I'm programming a scout bot that scans, finds ...
117 views

How do I set angular velocity/torque so that it's pointing to velocity/direction?

Right now, when I spawn a shootable object, it goes like this: Because I just set it's angle to this: float aimAngle = (float) Math.atan2(velocity.y, velocity.x); bullet.setBodyAngle(aimAngle); ...
998 views

How to find point on a circle that's opposite another point?

How do I find the coordinate of point and angle value on circle sprite which placed on opposite side of sprite from a touch point and the center point of the sprite? I know A position, B position and ...
5k views

Getting the angle between two objects?

I have a set of boxes which create a sort of path, they don't intersect very smoothy and to help that process I'm trying ot find a way to get an angle between them that can make it easier to generate ...
2k views

How do I interpret the dot product of non-normalized vectors?

I know that if you take the dot-product of two normalized vectors, you get the cosine of the angle between them. But if I take the dot-product of two non-normalized vectors (or one normalized, one ...
2k views

How to calculate left/right oriented angle between two 2D vectors? [duplicate]

I would like to calculate angle between two 2D vectors. Here's a picture of what I'm trying to achieve: I have an obstacle line segment AB and incoming moving PC. If I'm coming from one side C¹D¹ ...
707 views

what does AngleVectors method in quake 3 source code does

I just downloaded quake 3 for learning purposes. I know some of some linear algebra(basic vector math ie: dot,cross product). However I can't decipher what below method does, I know what is yaw,pitch ...
156 views

Surface normal to screen angle

I've been struggling to get this working. I simply wish to take a surface normal and convert it to a screen angle. As an example, assuming we're working with the highlighted surface on the sphere ...
127 views

3D 3-axes rotation into 3D 2-axes rotation

Hello everyone and thanks in advance to anyone who'll help me through this ! I am currently working on the Kinect V2 (for XBox One) to interact with an avatar. I'd like to use the rotation quaternion ...
1k views

How to get enemy to follow character using angles? (atan2)

I have an enemy and a character to control. I want to get the enemy to follow the character in a straight line. I already found the angle in which the enemy needs to travel. double angle = Math.atan2(...
529 views

2D field of view detection inverted

I'm not sure if the title matches what I'm actually facing I'm trying to test if I can see a point is in my field of view (in the context of an NPC seeing in it's direction.) I know that: cos0 = (A....
78 views

How can I move an object in a direction other than the ordinals?

I want to move a game object from its current position to the mouse position, but my current code only ever moves in one of the eight ordinal directions. In other words, I want it to move along the ...
48 views

Calculating angle a segment forms with a ray

I am given a point C and a ray r starting there. I know the coordinates (xc, yc) of the point C and the angle theta the ray r forms with the horizontal, theta in (-pi, pi]. I am also given another ...
664 views

How to rotate a 3D character on top of a plane with an isometric picture on it

How to calculate the angles of the 3d charater so that it fits into the isometric environment projektet on a 2d plane? Also, how do you calculate the rotation of my character? What I want to achieve: ...
230 views

How do I ADD gravitation to a rotation matrix?

I have ported the Matlab script from https://instruct1.cit.cornell.edu/courses/bionb441/LSystem/ to POV-Ray and everything works fine (although I'm not quite sure why). To navigate a "turtle" through ...
937 views

Matrix Rotation with three Angles

I want to rotate a form with three given angles fo each of the three axis. But the GLM rotation function takes only one angle and a vector as arguments. How can I convert between both formats?
81 views

atan2 : inversed result? (angle 180 is on the right side, angle 0 on the left side)

the result of the angle between my touch and the middle,bottom of the screen gives me 180 when the touch is on the right side of the screen, and 0 when it is on the left. I don't understand why... ...
287 views

Simple way to shoot bullets from a ship at angles for shoot em up

Just like the title says. I'm working on a shoot em up for a personal project, and I can't seem to get this to work. I don't have any code for it, but I do have the code to make my ship shoot, but ...
4k views

Using atan2 to calculate angle between two vectors

I understand that: atan2(vector.y, vector.x) = the angle between the vector and the X axis. But I wanted to know how to get the angle between two vectors using atan2. So I came across this solution: ...
2k views

Unity: parallel vectors and cross product, how to compare vectors

I read this post explaining a method to understand if the angle between 2 given vectors and the normal to the plane described by them, is clockwise or anticlockwise: public static AngleDir ...
145 views

Drawing a lines radiating from every angle using Bresenham line algorithm

I am trying to recreate a image like this ... or just each point Using Bresenham line algorithm, but can't seem to able to do so.. The point i receive from my computation doesn't look like a like, ...
196 views

Most efficient way to calculate angle between two line-segments that do not necessarily touch each other

Although I found answers on calculating angles from vectors, I didn't find a specific way to calculate angles between line-segments that do not necessarily touch each other (I say "not necessarily ...
2k views

How to move Vector2 along angle?

These are my Vector2's that I am using for this function. public Vector2 position = new Vector2(); public Vector2 velocity = new Vector2(); public Vector2 movement = new Vector2(); public Vector2 ...
446 views

How do you make a bullet ricochet off a vertical wall?

First things first. I am using C# with XNA. My game is top-down and the player can shoot bullets. I've managed to get the bullets to ricochet correctly off horizontal walls. Yet, despite using similar ...
113 views

Dealing with angles in 3D

In 2D everything is easier to understand. I'm not enought experienced to join people who say that 3d is the same: you JUST need to add a dimension - THAT adding a dimension is my problem, bacause I ...
645 views

Tangent to a circle through a point

I'm trying to figure out how to calculate the following angle: I know center (p1) and radius (r) of a circle. Given a point p3 I want to calculate the angle a such as the tangent (tan) of the circle ...
440 views

How can I determine the direction of turn?

I want a function that gives me the turn direction for my object (1 or -1) I have two angles 1 - current rotation(A) 0 <= A <= 360 2 - target rotation(B) 0 <= B <= 360 int turnSide =...
56 views

Algorithm for spacing points out among a line

I'm writing an angled tile system, and my implementation is to have a starting height and an ending height inside the tile. Like so: The starting and ending height allow me to get the length of ...
26 views

Using angle_difference to calculate shortest turn to target [Gamemaker]

I've tried, but I cannot understand angle_difference. I have an object, oTurretDetTurret, which turns to face its Target, which lies at the angle DirectionOfTarget from it. It does this by updating ...
149 views

Unexpected quaternion rotation behavior

First off let me apologize for the vague title but I really couldn't think of a more descriptive one (maybe after reading this a more advanced user might be able to edit it). Alright, so I have been ...
27 views

Light intensity on plain from angle

Given a vector (v) for the direction of light and a vector (n) for the normal of a plain. How can I calculate a rudimentary intensity value (i) where When (v) points at (n) directly/face on (i) = 1....
96 views

How do I make a box don't slide up/walk normally on a slope?

I'm trying to implement slopes in my game. When I walk up the slope and suddenly stop, here is what happens: And when I move down, it goes like this: I have set density to 0.5, friction to 0 on ...
40 views

How to get a difference of angles in one mathematical expression? [duplicate]

I need to do this for AI and also range calculation over a curved surface. I have two angles, a1 and a2, which can be in the range from 0 to 359. I need to calculate the difference between them, and ...
36 views

add the variation of the angle to its current angle: trouble with 180 and -180

I need to rotate a character, I would like to add the variation of the angle to its current angle. But my values are between 180 and -180. So if my character is at -179, then he goes right, it arrives ...
346 views

unity3d-Find angle between 3 vector3 points obtained from swipe

I was trying to find the angle between 3 vector3 points obtained from the screen swipe. The first vector3 point is the first touch position fp, the second is some intermediate touch ip and the third, ...
319 views

Getting and Setting Rotation in XNA around the Center of my Model with XNA

Alright, so I'm currently debating how I want to do this. Basically this is what I'm trying to accomplish. I've created a system to allow me to make my environment a little bit easier. I'm ...
488 views

Ball bouncing at a certain angle and efficiency computations [closed]

I would like to make a pong game with a small twist (for now). Every time the ball bounces off one of the paddles i want it to be under a certain angle (between a min and a max). I simply can't ...
36 views

Object has its heading stored as Euler angles. After it makes a turn, how do I calculate the new angles?

Assume said object is an aircraft. I store three angles (in degrees) that describe where it's headed: yaw, pitch and roll - in that order. Let's say the plane is flying vertically, upwards. The angles ...