The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
2answers
55 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 ...
0
votes
1answer
27 views

How do you convert angle with velocity to x velocity and y velocity?

This question can be simplified to: If you lean a pencil of a certain length at a certain angle what is the x and y position of the tip? So, basically, I am making a game that plots a balls path ...
1
vote
2answers
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 ...
0
votes
0answers
20 views

Rotating a UI arrow according to the change in camera's rotation

I have been trying different alternatives to do what is a very basic thing but I couldn't have any success. What I want to do is this. I have a 2D UI sprite at the screen, formed by 2 triangles, with ...
1
vote
0answers
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....
0
votes
0answers
36 views

UNITY 3D - Get X and Y components relative to a value and an angle

I have an algorithm, that, once the gameObject collides with a trigger, a method is called, on which the current collectibles (almonds) picked are instanciated around the circular area of the ...
0
votes
1answer
42 views

Rotate smoothly object to angle (Y axis) of the collided object

Well, let's say I have two planes, one which I am moving, and another one that I collide with, that has a different y rotation. I want to make that, once both planes collide, the plane the user ...
0
votes
1answer
75 views

In Game Maker Studio, why does the image rotation have to be performed every step?

I'm a software developer who's trying to get into game development casually on the side. I picked up Game Maker Studio a while ago on a Steam Sale, and I'm finally getting into using it, especially ...
0
votes
2answers
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 ...
0
votes
2answers
70 views

How does this math behind converting angles to vectors work?

I calculated the vectors of my yaw and pitch successfully. Even tho it works fine, I can't seem to understand how the math works exactly. Could someone (graphically / demonstratively) explain me this ...
1
vote
1answer
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 ...
4
votes
2answers
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); ...
6
votes
3answers
257 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 ...
1
vote
3answers
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 ...
0
votes
0answers
81 views

How to get the angle an object is travelling at

I'm trying to figure out how to get the angle an object is moving at, but have ran into a few problems. My player object is moved by rotating the entity left and right by using the left and right ...
1
vote
1answer
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, ...
1
vote
1answer
193 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 ...
1
vote
0answers
39 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 ...
3
votes
0answers
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 ...
1
vote
1answer
35 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 ...
0
votes
0answers
23 views

Unity - Decrease/Increase the “Z axis” angle axis on Update()

What is the best way to Decrease/Increase an angle without using "eulerAngles"? I need turn my transform between 30 and 325, according to my "Y axis". If it is less than zero we reduce the value of "...
-1
votes
1answer
183 views

What is the best way to send/receive data about user coordinates and other properties?

For example If I have 2 users, and each of them have an object, and that object has: x coordinates, y coordinates, angle, state, and other properties... I use java let'say the game changes at 30 ...
1
vote
3answers
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 ...
0
votes
1answer
194 views

How to use atan2 to get the correct angle? (inside or outside angle) [duplicate]

I would like to rotate an object (white rectangle) towards another object (black rectangle). EDIT: the white rectangle (at the top) has a camera. I finally rotated the camera by 180 around the "y" ...
0
votes
2answers
224 views

Vector3.Angle() Never Reaching 0

I'm having trouble understanding why with this script, Vector3.Angle() sometimes will never reach 0. This question comes from me trying to make a "turret" that rotates to face a target position. It ...
1
vote
2answers
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... ...
0
votes
2answers
150 views

How to move dashes towards target?

Would you know how to create a dash line that moves towards the direction of the target, and if it collides with a wall, goes to the opposite angle? I have seen atan2 but I am not sure what it does, ...
3
votes
3answers
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 ...
0
votes
2answers
218 views

Casting a directional line of which an object is coming from

I want to create a directional line ( curve / linear ) depending where the direction is coming from. In some games, similar to Angry Birds, a dotted guideline is shown to provide where the gameObject ...
4
votes
2answers
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 ...
0
votes
0answers
48 views

Euler angle and quaternion rotation [duplicate]

If I have a player at [12,0,54] and an enemy at [5,0,-9], to calculate the Euler angle for the enemy to rotate and face the player, would I subtract enemy minus player positions and then divide that ...
3
votes
2answers
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¹ ...
0
votes
1answer
46 views

Point to coordinate function

I am working on a game in which I need an enemy ship to point towards the player. Here is the equation I came up with: angle = sin-1(abs(y1 - y2)/√(x1 - x2)2-(y1 - y2)2) This essentially takes ...
2
votes
1answer
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 ...
2
votes
2answers
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 ...
0
votes
1answer
295 views

How do I find the angle between two 3D angles represented in this form?

I have two 3D angles, represented by [a1,a2] [a1,a2] where the a2 is < 180. My coordinates are represented as [X,Y,Z], where X,Y,Z are 64 bit ints (longs in my lang). My direction angles are ...
1
vote
0answers
345 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, ...
0
votes
4answers
150 views

Bridge made out of blocks at an angle

I want the player to select 2 points (vectors). With these 2 points a floor should be created. When these points are parallel to the x-axis it's easy, just calculate the amount of blocks needed by a ...
3
votes
2answers
993 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 ...
0
votes
1answer
87 views

3d rotation of a Gunner unit to shoot the target

I'm developing a scenario to shoot incoming targets by a specific gunner unit, however I'm confused to actual logic of shooting an object with a gun. I'm working in 3D environment. I'v target's ...
1
vote
1answer
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 ...
1
vote
1answer
444 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 ...
2
votes
3answers
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: ...
-2
votes
1answer
396 views

How to know the relative facing angles between two players? [closed]

I want a grappling system similar to Tekken, in which different grapples animations are performed depending on which side of the opponent the player performing the grapple is facing. For example, ...
1
vote
1answer
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 ...
1
vote
1answer
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: ...
-1
votes
2answers
244 views

What Should the Limits On the Camera's Pitch Be? [closed]

What should I be using as the limit to how much a camera can pitch in a first person video game? I'm assuming most video games use around the same value - so if I can use that value in my game, it ...
36
votes
4answers
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 ...
0
votes
1answer
23 views

Angle Adjustment on the Y Axis

I just started learning 2D game development using CreateJS and I was reading this article about angular velocity to learn how to correctly move a sprite in both x and y axis. I understand most of it ...
2
votes
1answer
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 ...