A mathematical concept that can be used to express position, direction or velocity and which can simplify or outright trivialise spatial problems.

learn more… | top users | synonyms

0
votes
0answers
22 views

Unity C# - The object of type 'Object' has been destroyed but you are still trying to access it

I have a cube on a plane and I'm tring to move it to certain locations. I've baked the area and added a navmeshagent to the cube. My moving script for the cube looks like this: using UnityEngine; ...
1
vote
1answer
71 views

Java Distance between two Vector positions never 0

I have a Player moving, but when the player reaching the destination it should stop. But problem is that distance never return 0. It starts printing this: 0.9672514210000003 End by this and then ...
1
vote
1answer
37 views

Unity Vector3.Angle() direction

I have a space fighter AI. I need to determine how to pitch, yaw and roll the craft to aim at the target. My current solution: To obtain the Yaw angle to position the target above the fighter, ...
3
votes
3answers
84 views

Does AddForce continue to add force indefinitely?

Does the AddForce method continue add velocity to an object forever? Does it need to be limited by another line of code? Sorry if it is too broad or too simple; I am completely new to programming and ...
0
votes
1answer
66 views

Unwanted roll when rotating camera with pitch and yaw

I have a quaternion class implementation, and when I apply this class to my objects all gone right (rotations), but I have a lot of troubles with the camera. I've been searching a lot trying to solved ...
2
votes
1answer
37 views

2d vector flips during rotation

I have a 2d game (C++ and SDL) and I want the player object rotate to follow the mouse. The player object and the mouse location are both stored in 2d vectors. In order to have the player's rotation ...
0
votes
0answers
28 views

How to make this vector field animation

This screenshot is from Windows app called MyRadar by ACME AtronOmatic LLC. I found their wind direction animation to be very visually appealing and was wondering if anyone knew how to create this ...
1
vote
1answer
82 views

Shooting Projectiles

I am using cocos2D-x and am trying to achieve the effect of enemies going past and shooting projectiles at the player who is moving around the screen. I am using the code below, which is based on this ...
1
vote
1answer
54 views

Simulating elastic ball collisions quickly escalates to disaster

I'm trying to learn HTML canvas and was working on a basic physical simulation, where a number of balls are drawn and set in motion, and the program simulates them colliding and bouncing off the walls ...
0
votes
1answer
72 views

Getting the Right Vector from the Forward Vector

I'm currently working on a small Camera (ArcBall) and I finally am starting to understand how it will work. I will first create a basic View Matrix using a LookAt function. Then, I will send the ...
4
votes
0answers
103 views

Implementing proportional navigation in 3D

Good afternoon guys, a = N * λ' * V is the formula for the commanded acceleration required to hit the target, where N is the proportionality constant, λ' is the change in line of sight and V is ...
0
votes
0answers
12 views

Correcting Vectrosity wire frame line normals

Current Setup This is my current scene, you can see that as the sphere rotates it looks like at the edges(90 degrees) to our normal you see the lines fine but dead on the almost disappear. Grid ...
0
votes
2answers
84 views

How do I handle parallel lines when looking for intersections?

I'm using the following method to determine the intersection point of two vector2: public static Vector2 LineIntersectionPoint(Vector2 startPoint1, Vector2 endPoint1, Vector2 startPoint2, Vector2 ...
0
votes
1answer
33 views

How to rotate a triangle to look at a point?

Lets say I have a triangle defined by 3 vertices and a center point, how do I rotate the triangle so its normal is looking at a specified point?
0
votes
1answer
28 views

Position of an object relative to another in a 2D plane

I have two objects, A and B, each of them has a set of coordinates (x,y). How do I understand where is A in relation to B's position? If I where to just check each coordinates I could do it like this:...
1
vote
4answers
99 views

Get perpendicular vector from another vector

I should clarify that I understand there is an infinite amount of 'perpendicular' vectors in 3D space. I am creating an electricity effect, and to do this the ability to have any number of ...
0
votes
1answer
54 views

Convert a modified Transform.forward to world space

I am trying to make an electricity system, where it is given the start and end points and it works out a random sequence of points in the rough direction of the end point. These points are set as ...
3
votes
4answers
141 views

How to get the closest “visible” object from my “player”?

I'm using Unity 3d and i have to accomplish the following task: get the closest "visible" object to my player in forward direction. It is a sort of radar. I don't know where to start. Any advice ...
1
vote
1answer
37 views

Smoothing a rotation vector

I am currently using OpenCV to track the face of a person. With this I extract the feature points and calculate the objects heads pose by applying the "solvePnP" function. This function gives me a ...
3
votes
2answers
96 views

Why does transforming a Vector3 by a Quaternion result in reversed Z?

I'm trying to transform the vector (1, 0, 0) by an orientation unit quaternion, which in XNA should be: Vector3 v = Vector3.Transform(Vector3.Right, Orientation); But this results in the Z value ...
-2
votes
1answer
17 views

how can i take the value of a vector 3 from a liste of vector 3 [closed]

foreach (Vector3 posit in position){ if (ang){ float a = Random.Range (0.0f, 60.0f); //Vector3 p1= new Vector3((position[i-1].x)+(ra*cos(a)),0.0f,(position[i-1].z)+(ra*Sin(a))); ...
0
votes
0answers
50 views

Dot product not working as expected

Recently I am learning dot product, While below code works from Unity's documentation, http://docs.unity3d.com/ScriptReference/Vector3.Dot.html public Transform other; void Update() { ...
0
votes
1answer
33 views

Limit Quaternion/vector3 axe in a certain interval

I have some trouble to understand, and handle Quaternion and Vector3. I'm improving the tutorial Tank of Unity: EDIT: Because a video explain so much better, there is a link to the 30 secondes video ...
1
vote
2answers
29 views

Translating a world position to an array position

Lets keep this simple, so, assuming I have an array like this ... var array = new bool[10,10,10]; .. and then I have a start and end vector3 ... var start = new Vector3(-21,-21,-21); var end = new ...
2
votes
1answer
66 views

Should I Include the W-component of a vector when calculating it's length or dot product?

The reason I'm asking this is because I saw an implementation which did it that way but I don't quiet understand it. I mean, usually I want to get the distance between two points in 3d space and if W ...
0
votes
1answer
68 views

Player position not updating when referenced in seperate class?

In my player class I have my players position set to update when you tap the directional keys, that works fine, but when I access my Players position variables, in my projectile class constructor, ...
1
vote
1answer
99 views

How to clamp a direction vector within a direction pyramid?

In 2D you can specific an angle range such as [-45 to +45] and clamp a 2D direction vector within that angle range. I want to have something similar for 3D. I want to specify the allowed directional ...
0
votes
3answers
281 views

How to calculate the closing speed of two objects

I have the 2D positions and 2D velocity vectors of two objects. How do I calculate the closing velocity ? I want to get the closing speed. Think of one jet tracks another jet with radar and you want ...
0
votes
2answers
35 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
68 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 ...
0
votes
3answers
48 views

Velocity Relative To A Vector

So I have a velocity vector b in world space and I have a "pointing" vector a in world space. I need to know how to make the velocity vector to be relative to the "pointing" vector. Better explanation ...
-1
votes
1answer
44 views

How do I get a vector from an angle?

I want a ship to move forward in the direction it's facing when you press the up key, but I don't know how to get a normalized vector from the angle the ship is facing. Can someone show me what code ...
0
votes
1answer
57 views

Getting vector relative to other vector in rotating object

So I have a rotating object a. It is rotating at non-constant speed around it's local x axis. It is parented to object b. When the object a rotates, it's local x axis stays facing the same direction ...
0
votes
1answer
169 views

How do you build a rotation matrix from a normalized vector?

I'm trying to find the correct way to build a rotation matrix from a unit vector. I have two arbitrary points in space (p1 and p2), and I'm trying to create the vertices for a rectangle to span ...
0
votes
2answers
43 views

Get vector3 position of Cursor on a fixed 2D plane within a 3D scene

How is it possible to get a cursors X and Y Location relative to the scene planes rather than using co-ordinates based upon pixels of screen height and width? I have the start of a very basic game, ...
0
votes
0answers
32 views

What Is Vector Math? [duplicate]

Okay so I was wondering, what exactly is "Vector Math"? I was wondering if I needed to know physics for game development, and most people said you just need to understand the basics, but they said ...
1
vote
0answers
90 views

Euler angles to directional vector

I wanted to implement a directional light system in my game, and instead of passing the direction to the light, I chose to use an angle, and only later convert it to a directional vector, so it is a ...
0
votes
2answers
85 views

Moving a ship forward from rotation

I am making a simple space simulator, where the player can control a ship using 2 controls, one for pitch and one for bank. The ship is properly rotated but I cannot figure out how to make the ship ...
3
votes
2answers
144 views

Vector math to calculate the rotation and drift of a tectonic plate?

I've been following the excellent Experilous procedural planet generation post, trying to recreate it in Java using libGDX. My planet is simpler, as it lacks any distortion of the mesh. It's just ...
1
vote
0answers
30 views

Movement for Box2D Bodies

I'm having trouble wrapping my head around something that should be relatively simple. I'm making a breakout clone using LibGDX and Box2D. I'm also using the Ashley ECS. For movement with bodies, I ...
1
vote
1answer
57 views

find Vector2 libgdx

I need to get coorinates of red point. Coordinates are just for example, it would be better to see the common formula. Found code like this, but it gains wrong result.() Vector2 o = new Vector2(6f,2f)...
6
votes
2answers
250 views

How to apply friction vector to acceleration in top-down 2D game?

I'm making a top-down view 2D RPG game, meaning the player can move in any direction on a 2D plane, and I'm trying to implement a somewhat realistic non-orthogonal acceleration/friction physics model ...
0
votes
2answers
79 views

How to convert velocity (Vector) to m/s (Scalar)

I have a variable called velocity which I get from a dynamic body in Box2D. It is the velocity of a pirate ship and when I add torque to the ship I want that to be proportional to the speed (m/s - ...
1
vote
1answer
77 views

Should I store local forward/right/up vector or calculate when necessary?

I'm working on an object picking and translation/rotation/scale gizmos system in my engine where you select objects and perform transformations on them in a 3d editor-like fashion (e.g. Blender) In ...
0
votes
1answer
172 views

How to rotate a triangle towards the point in Qt?

I have an issue with items rotating. I have a point and a triangle which needs to be rotated with its apex point towards the taregt point. The right side of the picture represents how it is should to ...
-2
votes
1answer
56 views

how to set in vector float x y coordinates [closed]

i am use eclipse java android i am try to projectile trajectory in my game like angry birds example here http://blog.gemserk.com/2012/07/03/drawing-a-projectile-trajectory-like-angry-birds-using-...
0
votes
0answers
69 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
44 views

Vector out of range (Batch rendering & opengl)

So ive (tried to) implement a batch rendering system, and at the for loop the error pops up and I'm not shure what ive done wrong. Any suggestions to improve the system would be much appreciated. (It'...
2
votes
1answer
98 views

Ball's velocity vector, reflect against a point

I need to calculate the new velocity vector when the ball collides with one of the paddle's corners. Let d be the velocity vector of the ball, r the target velocity vector and n the surface normal ...
1
vote
1answer
98 views

How to calculate a vector for multi-axis rotations from sphere coordinates?

I'm working on a SceneKit project in iOS, trying to rotate a sphere (representing a planet) so that a point at a given longitude/latitude coordinate is facing "forward" (i.e. that point moves to the {...