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
10 views

Adjust Object Velocity depending on Rotation

I am building a vehicle handling line in hyperPad, with no luck. I have a "gas pedal", and the vehicle. I can use add, subtract, multiply, divide, mod, get Rotation, get Velocity and set Velocity. ...
3
votes
1answer
94 views

C++ alternative to vector for arbitrary number of objects using pointers

I'm working on a prototype 'life simulation' game which incorporates any number of objects / entities that may exist in the game. Up until this point I had been working with vectors of the objects, ...
2
votes
2answers
47 views

How can I rotate the camera for a player walking around the surface of a sphere?

I'm making a 3D game where the player can walk across the surface of a planet. I am having a problem correctly rotating the camera's frame of reference, so that the camera is oriented correctly ...
1
vote
1answer
18 views

Rotation smoothing with Slerp snaps to center when switching between different destination vectors

I'm making a 3D space shooter in Unity (think Star Fox). The ship, when I move it around the map, should rotate slightly (smoothly) in the direction I'm controlling it. I have smoothness mostly ...
0
votes
1answer
38 views

How to place text centered on the player? XNA

As I can make a text of the size of this, it is centered taking reference of the player? Right now the following happens: I want: code: spriteBatch.DrawString(Font, player.Name, new Vector2(...
1
vote
1answer
23 views

How to calcolate moving vector of object by its rotation degress in 2d

i have object in game which is rotating when i move my joystick , now i need to calculate its movement vector by its rotation the object always moving forward and controlled by the joystick , the ...
0
votes
0answers
24 views

Keeping track of space objects: enemies, projectiles, players

I have a Vector called spaceObjects of type SpaceObject that contains all types of SpaceObjects: Heros, Projectiles, and Enemies. I've added all these to this one Vector because I'm passing it all ...
1
vote
2answers
34 views

Calculate target angle to a certain Vector

I'm developing a 3D game in LWJGL. I have a player class and a monster class and I need the monster class to chase the player when the player is within a certain distance. For that I have the monster ...
0
votes
0answers
37 views

How do I normalise vertex normal vector in C#?

I have a binary file format with vertex positions, normals, UVs and weights. It all works fine, except I can't understand how to get vertex normals out of it. V normals are recorded as bytes1 (one ...
1
vote
1answer
32 views

Garry's Mod gamemode scripting (lua) - How do I tell if an object is inside a hollow cylinder?

I'm fiddling about with gMod trying to make a gamemode where you have to throw a piece of cake into a cylinder that spawns on the map. This is the code I'm using to spawn the cylinder: local ent = ...
0
votes
1answer
30 views

2d animation on html5 canvas using a vector and speed

Im moving a starship from one location to the other. In creating a vector, normalize and magnitude it. Lets assume my vector looks like this Vector x: 156, y: -90, m: 180.0000000546, ...
0
votes
1answer
17 views

Lengthen Line (bidirectional) - crossing zero line

I'm trying to lengthen a line, by a certain amount. I want to apply the modification to both points on the line, expanding it in both directions. without moving it from it's current position (center ...
1
vote
1answer
24 views

Pitch/Yaw in circle causes undesired Tilt [duplicate]

I've made my own Camera object, with a forward vector as well as a up vector. I happen to be programming in Android using OpenGL ES 2.0 but I think this question is relevant to all frameworks, it ...
0
votes
1answer
25 views

MonoGame - scale down a sprite from the middle

I want to animate a texture's scale. First it's scaled up to 10, and then it gradually goes down to 1. However the texture is drawn at Vector2(0, 0) so it doesn't animate as I had imagined it would - ...
1
vote
1answer
53 views

LibGDX: How to make something like vector rotation sensor with accelerometer and compass values?

So I've tried the vector rotation sensor using the Android API and it works perfectly to do what I want, but LibGDX does not support this sensor. I've been searching and it seems like I can do the ...
0
votes
2answers
61 views

Unity3D: Find Raycasthit direction

I'm trying to make a Billiard game and I wanna calculate the direction on which the Cue Ball(white ball) will be moving after it hits another ball. As you can see I wanna calculate the angle/...
0
votes
0answers
17 views

Javascript applying thrust to my inertia

I'm using http://www.mathguide.com/lessons2/Vectors.html#combining as a reference. Their magnitude values are too large for my pixels so I'm decreasing by a factor of 100 - so the 30 magnitude becomes ...
1
vote
1answer
51 views

Computing how fast a vector should go toward certain direction

I have two object in space, one has velocity (object A) with fixed magnitude, and one is static (object B). every timestep, I add to object A's velocity a vector which direction is object A to object ...
1
vote
1answer
62 views

Clamp camera view angles relative to moving object

I have a camera attached to an entity that moves in a circular pattern around a fixed center position. I am attempting to clamp the rotation of the camera such that it can only look inward toward the ...
0
votes
1answer
49 views

Change sprite angle on sloping ground

I have a problem here with GameMaker built-in physics environment.My player is designed to be on a skateboard. I want my player to rotate its sprite, according to the kind of fixture(up or down slopes)...
1
vote
2answers
56 views

Move to specified coords - libgdx and java

So I am making my bullets go to a point and travel further. Only its acting really really weird. Its like its thinking that the 0,0 location is at the top left instead of the bottom left. This is the ...
0
votes
1answer
30 views

Turning x and y difference between two points into a projectile moving between them at a fixed speed

In a libgdx project of mine, I have two units on a 2d field who want to fire at each other. They both know the x and y distance to each other by subtracting their enemies position from their own: ...
1
vote
0answers
97 views

Polygon 2D collision response- How do I find the correct edge a polygon hit?

Hey guys I've been seriously stressed out by this, so please go easy on me. My goal is to reflect a bullet (polygon) off of another polygon, and find the edge the another polygon, A (the bullet), hit....
1
vote
1answer
105 views

How to align a hint arrow to point along a path?

I am using CalculatePath and trying to use path.corners in order to give user a hint for path, that where should he lead next. I am using first two instances of Vector3 of path.corners. Lets call ...
0
votes
0answers
28 views

Vector and aabb collision [duplicate]

Im having trouble with bullet collisions for a 3d game. I've seen many solutions but they either don't work for my case or are way to complicated. Can someone explain in a pretty simple way how to ...
1
vote
0answers
70 views

Moving along the surface of a mesh?

I'm trying to replicate the movement in this game: https://www.youtube.com/watch?v=OcvD8BXars8 The players ship along with all other game elements move along the surface of a mesh. I've tried ...
0
votes
0answers
48 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
103 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
2answers
119 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
107 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
141 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
49 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 ...
1
vote
0answers
54 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
100 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
59 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 ...
1
vote
1answer
203 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
123 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
31 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
103 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
36 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
50 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
204 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 ...
2
votes
1answer
95 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
190 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
74 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
98 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
18 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
73 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
37 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
33 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 ...