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
1answer
72 views

Projecting a light onto a quad

I need to project the light onto the quad and use its value for translating the vertices. I'm currently having 6 vertices, two quads, The points are A X C B Y D Point X, Y are coming from two ...
0
votes
0answers
23 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 lines, like two lines that start from (x,y,z) and leave at a 15 degree ...
0
votes
0answers
61 views

How to rotate a line in 3d space?

I am trying to figure out direction vectors of the arrowheads of an arrow. Basically I'm given a normalized direction vector (u,v,w) and I need the normalized direction vectors of the its two arrow ...
0
votes
1answer
68 views

Relative Position/Rotation calculation

I have 2 objects each with a 3x3 Matrix (Orientation) and a Vector3 (Translation). Both are relative to world coordinates. How do I calculate the position and orientation of object B in relation to ...
1
vote
1answer
139 views

Detecting walls or floors in pygame

I am trying to make bullets bounce of walls, but I can't figure out how to correctly do the collision detection. What I am currently doing is iterating through all the solid blocks and if the bullet ...
0
votes
0answers
44 views

Script to intelligently move aircraft using curves [Unity]

I am trying to code a script to move an aircraft entity from point A to point B and at some point in the middle of moving have the aircraft forward vector face Point C (to fire a missile at an enemy ...
1
vote
1answer
153 views

Converting 3 axis vectors to a rotation matrix [closed]

I am trying to get a rotation matrix (in 3dsmax) from 3 vectors that form an axis (all 3 vectors are aligned by 90 degrees each other) Somewhere I read that I could build a rotation matrix just by ...
0
votes
1answer
95 views

Separating axis Theorem rotation issue

I made a post yesterday to see if anyone could understand my problem. However I did not receive much guidance, probably because my question was not clear. I have worked on it a little more and ...
-2
votes
1answer
84 views

How to remove line between two Points XNA 4.0?

I'm new to XNA and wondering if it is possible to remove a line (that lies between two vectors) when the mouse clicks on that line. I've searched everywhere but I can't seem to find anything. My ...
0
votes
1answer
115 views

Make Gameobject Stand On Surface Facing Certain Direction

I want to make a biped character stand on any surface I click on. Surfaces have up vectors of any of positive or negative X,Y,Z. So imagine a cube with each face being a gameobject whose up vector ...
2
votes
1answer
114 views

What is Vector Projection and what is it's use in games?

Couldn't find a clear enough answer on Google. I know what vectors are. But what does it mean to project a vector onto another, and what is it used for in games?
1
vote
1answer
654 views

Basic Car Movement, Converting 2D Vectors to 3D problems

I'm trying to follow this guys method for steering a basic car. Link. It's the first example I can sort of get my head around and I'm trying to convert it to a working 3D version. To get some scope, ...
0
votes
0answers
29 views

How to move objects flat on different planes in 3d?

I need to move objects in circular/square/sinusoidal patterns in a flat manner on a collection of different and rotating planes in 3d space. I have the perpendicular of the planes. One method is to ...
0
votes
2answers
86 views

Using a vector to store multiple instances of a class

To warm up with SMFL, I am creating a simple Block Breaker game. For the blocks and balls, I would like to store them as "instances" in a vector so that they can be added/removed with ease. However, ...
0
votes
3answers
66 views

How can I calculate force and acceleration?

I have problem of calculating the movement of the object. At the moment, I have a vectors calculated from the center of the screen minus the position of the object. direction vector = centerScreen ...
1
vote
1answer
442 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 ...
2
votes
2answers
25 views

Derive direction in which a spot light emites its light from a projection matrix

First of all, sorry if my question sounds too basic or even makes no sense. I'm new with game development I'm working with HPL1Engine, specifically, the lights parts. I need to know the direction in ...
0
votes
1answer
46 views

Getting the position of a directional light w.r.t. a moving object.

I have a forward vector of my object, which is a bike, and its position, and I have a directional light direction. I would like to know where the light is with regards to the bike ...
1
vote
2answers
152 views

How can I project a vector on another vector?

I have a generic not normalized Vector3 v1 and I want to calculate its component along another Vector3 v2. I used to normalize the vector I want to be the direction and then multiplying the other ...
0
votes
1answer
66 views

How do I lock drawn lines to be orthogonal to an existing one?

I'm making a 2D game in Corona for Android/iPhone that is similar to Volfied. In my game, the user has to touch the screen to draw a line for the character to move along. How can I force the lines to ...
1
vote
1answer
241 views

View to normal calculation in GLSL

Sorry for the terrible title, but I really cant think of anything better.. Suggestions welcome. I am trying to do something like showcased in this video: http://www.youtube.com/watch?v=CaTI2d0tQME ...
1
vote
2answers
102 views

Adding an angle variance to a 3d vector

I am converting a particle emitter from 2d to 3d. In the 2d system the original coder used a random angle variance and added it to the angle. So it would be something like: thisAngle = emitterAngle ...
1
vote
2answers
79 views

matrix to rotate a vector to a known arbitrary axis

Let's say I have a vector V (v.x,v.y,v.z) which is normalized and points somewhere in 3d space. And that I have another vector Z of (0,0,1). Knowing only these two things I'm looking for a ...
0
votes
1answer
56 views

Tangent plane vectors smoothing with vertex normals [closed]

I'm trying to find a way to smooth out normals obtained from cross product of tangent and bitangent vectors calculated per face basis. I've already asked a similar question on SO, however with no ...
-2
votes
1answer
80 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, ...
2
votes
1answer
55 views

Get a random vector

I'm trying to make a small pariticle-like simulation, and I'm trying to make each parrticle go a random direction from one point (mouse pos). The problem is I don't know how to get the random vector ...
10
votes
2answers
478 views

Shooting the bullet out of the gun instead of the camera, yet keeping it accurate with respect to the reticle

I'm working on a first person game, and I've ran into a problem. In my game, there's the player's gun being rendered, as well as a reticle in the center of the screen - like this: First, Let's ...
2
votes
4answers
681 views

How can I implement a directional melee attack?

I am attempting to make a top down game similar to the SNES Zelda games, in Unity 4.3, in 2D. When my character swings their sword, every enemy within a radius takes damage. I want to make sure that ...
-2
votes
2answers
103 views

Convert atan2 value to standard 360-degree-system value [duplicate]

Lets say I'm using atan2 to get the angle between two vectors. atan2 gives a value in radians. I convert it to degrees using a built in function in Java. This gives me a value between 0 and 180 ...
-2
votes
1answer
82 views

How does atan2 work when getting angle of a vector?

I know that atan2 gives me the absolute angle of any vector. But it doesn't give a value from 0 to 360 degrees. Instead, it gives a value (if I'm not mistaken), between 0 and 180, or between 0 and ...
0
votes
1answer
147 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
vote
1answer
76 views

3D vector graphics - maintaining correct Z 'length'

So I'm trying to build myself a 3D display 'engine', or whatever it ought to be called. I've been experimenting with PyGame, as it's familiar to me. In a way this has almost been more an excuse to ...
4
votes
2answers
389 views

How do I use the dot product to get an angle between two vectors?

I am learning to use normalized vectors in my games. I've learned that in order to know the angle between two vectors, I can use the dot product. This gives me a value between -1 and 1, where 1 ...
1
vote
3answers
172 views

How to move an object along a vector

Let's say I got an object A and object B in a 2D game. I create a vector leading from A to B. It's name is AB. How can I make A move along the vector AB and reach B? One way I was thinking of doing ...
17
votes
4answers
11k views

How can I calculate the angle and proper turn direction between two 2D vectors?

I am working on some movement AI where there are no obstacles and movement is restricted to the XY plane. I am calculating two vectors, v, the facing direction of ship 1, and w, the vector pointing ...
-1
votes
3answers
367 views

Move player to mouse click

Im hopelessly not good at algebra and such. But im trying to learn. I want to learn and understand how to use it in game programming rather than modifying snippets or using classes that do it for me. ...
0
votes
1answer
45 views

What does it mean to cross a scalar with a vector in a 2D plane?

At the moment, I'm following this page to create a physics engine. As per that page, I need to cross angular velocity by a distance vector to get relative torque and such, but I'm not sure how (in a ...
2
votes
1answer
91 views

How do I compute the point of a triangle-ray intersection?

I have a line (the direction vector of the player) and a triangle representing the face of a model (so composed of 3 points). I can't find the mathematical operation to check if that vector is ...
0
votes
1answer
79 views

Creating a textured object infront of the current character in unity 3d

I've spent about half a day trying to get my head round this and i'm not having too much luck, essentially what I want to do is play an animation and then once the animation has finished create a flat ...
0
votes
1answer
51 views

How to modify normal vectors with a tranformation matrix

Transformation is quite simple when it comes to Position or Color of the vertex, for Position just multiply matrix * vector and for color just don't do anything, but my question now is: How to handle ...
3
votes
4answers
227 views

Why not use vectors to represent orientation?

From what I've read, people mostly use either quaternions or 3x3 matrices to represent 3D orientations, while plain vectors are used for angular velocity/momentum. Since we can use vectors to ...
1
vote
1answer
87 views

Does a 2D Vector or 2x2 Matrix play any role in 2D Transformations?

I'm having trouble trying to figure out if a vec2 or mat2 class are used at all in transformations for 2D rendering. Vec2, apart from representing UVs, AFAIK, is relatively pointless in regards to ...
11
votes
2answers
454 views

How do I find a point on a line?

I have two points (A, B) and the length of d. How can I find point C?
2
votes
1answer
135 views

Rotate Camera as an Object Manoeuvres

There are loads of questions (all of which I have looked at) on here about cameras following objects. Using them, I have successfully got my camera to follow my car when driving, but I am unable to ...
4
votes
1answer
2k views

How do I rotate a sprite so that it is 'pointing' in the direction it is moving?

I have a sprite, e.g a missile, heading in a certain direction (using a velocity vector). How do I figure out its how much to rotate it so that it gets drawn 'pointing' in the direction it is ...
-1
votes
1answer
75 views

Can not seem to adjust the speed of my Car

I'm programming in C++, rendering in OpenGL and using GLM for matrix/vector manipulation and I have implemented very (very) basic car controls; ignoring many forces that are present in reality. Since ...
2
votes
2answers
407 views

Relative cam movement and momentum on arbitrary surface

I have been working on a game for quite long, think sonic classic physics in 3D or tony hawk psx, with unity3D. However I'm stuck at the most fundamental aspect of movement. The requirement is that I ...
3
votes
1answer
137 views

Moving sprite from one vector to the other

I'm developing a game where enemy can shoot bullets towards the player. I'm using 2 vector that is normalized later to determine where the bullets will go. Here is the code where enemy shoots: ...
0
votes
1answer
149 views

Circle-Rectangle collision velocity adjustment

I created my circle vs. rectangle method based on this algorithm: http://stackoverflow.com/questions/401847/circle-rectangle-collision-detection-intersection Currently, I have a dynamic ball with ...
0
votes
0answers
55 views

Using Angles (or rotation) with Vectors for Car physics

I've been reading this blog that explains basic linear algebra for game developers and I understand the basics of vector mathematics. I'm using vectors to create a car that simulates the very basic ...