A mathematical concept that can be used to express position, direction or velocity and which can simplify or outright trivialise spatial problems.
2
votes
2answers
439 views
How to calculate vector that is perpendicular to the direction of moving in Flash?
In flash i have a class that extends movieclip and i am moving it forward, up and down, and rotating it. How can i calculate the vector that is perpendicular to this movieclip?
3
votes
1answer
251 views
Vector fields and game engine
It exist a game developed with a vectorfield game engine?
What I mean is that instead of calculating intersections, one could calculate the vector field generated for example by gravity, and for ...
1
vote
1answer
549 views
How do I get the vertical angle between 2 vectors?
So I'm modding a 3D game, my goal is to place a label on the screen pointing to the unit's direction. I'm getting the horizontal angle by projecting these vectors in a plane, like this:
private ...
1
vote
1answer
206 views
What can I use to generate 2d vector graphics as a list of coordinates?
I am working on a game that uses simple 2d vector graphics. I want a tool that will let me visually draw things like arbitrary polygons by placing points.
A perfect tool would present a grid that I ...
5
votes
3answers
865 views
Why aren't linked lists more common data structures for enemies?
I was recently listen to a talk that Jonathan Blow gave, you can find it here. In the talk, he was talking about what data structures he (and he seemed to imply many others) use, and why. Which is ...
8
votes
1answer
383 views
Downprojecting an imaginary 4D mesh to the screen
As a mental exercise, I'm trying to imagine projecting an arbitrary 4D mesh onto the screen (2D).
I'm guessing a single 4D triangle would still consist of only 3 points, however each of those 3 ...
1
vote
1answer
178 views
Mesh to world vector translation
Suppose I have a world defined in typical OpenGL coords.. then the up vector defined for this space is (0,1,0).
Now, if I load a model that is defined with (0,0,1) as its up vector, what are the ...
4
votes
2answers
1k views
How to calculate the vector of an interception?
Given are a twodimensional space, and 1 friendly spaceship standing still, one foe is moving NOT directly to the friendly ship with known actual position, speed and direction.
The friendly ship wants ...
1
vote
2answers
419 views
Circle collision detection and Vector math: HELP?
Hey so i'm currently going through the wildbunny blog to learn about collision detection, but i'm a bit confused on how the vectors he's talking about come into play
QUOTED BLOG:
p = ||A-B|| – ...
12
votes
5answers
2k views
Do I need the 'w' component in my Vector class?
Assume you're writing matrix code that handles rotation, translation etc for 3d space.
Now the transformation matrices have to be 4x4 to fit the translation component in.
However, you don't actually ...
9
votes
4answers
349 views
What exactly causes a surface to overlap another?
I cannot really figure out what causes one surface to overlap another. In a 3D engine I'm creating, my technique is failing in edge cases.
My method is sorting the surfaces to be painted from the ...
14
votes
6answers
3k views
Vectors in game development
I'm new to programming and game programming.
I've reading something about vectors and math, but I have a question - where do I use vectors in game programming? Maybe anyone can give a simple example ...
7
votes
3answers
1k views
Rotating a vector by another vector in shader
I have a terrain surface with a normal for each point on the terrain.
I have a second detail normal map to be applied to the terrain.
These normals are in 3-space.
The Y value of both normals is
...
5
votes
2answers
432 views
Collision Detection/Response in Vector-based levels
I have a 2D side scroller whose levels are stored as vectors (that is, a bunch of lines) which looks like this:
How would I detect that I'm colliding with one of these lines, and react accordingly ...
5
votes
1answer
954 views
Rotate object to face player
This is probably a simple vector question, but I'm not sure how to do it.
I have an object at vector position (ox,oy). Potentially every update, the user walks around the screen, and will be at ...
2
votes
1answer
428 views
Calculate the initial velocity of a 3D trajectory
I've got a 2D projectile code sample working, but would like to extend it to 3D. How would I calculate the initial velocity of the Z-axis? At the moment, I've got:
initVel.X = (float)Math.Cos(45.0);
...
3
votes
3answers
291 views
Adding 'swerve' to a direction
I'm not much of a maths expert, so this is probably quite straight forward. I was playing a soccer flash game where you take free kicks. You provide Power, Swerve and Direction. I'm reading up on ...
5
votes
3answers
606 views
Should we go for our Vector2Int/Vector3Int implementation or just use built-in float based vectors?
So in one of our projects we're using Vector2/Vector3's a lot but we do only use integer/byte values mostly. So up to the point we've implemented our Vector2Int, Vector3Int, Vector2Byte and so ...
2
votes
1answer
364 views
Calculating camera zoom value (top-down)
I need some help in 'camera maths'. I have a birds eye view of two characters. One character is static and the other can move. I would like the camera to always show both characters in full and, in ...
7
votes
4answers
617 views
Moving objects colliding when using unalligned collision avoidance (steering)
I'm having trouble with unaligned collision avoidance for what I think is a rare case. I have set two objects to move towards each other but with a slight offset, so one of the objects is moving ...
3
votes
1answer
817 views
Points on lines where the two lines are the closest together
I'm trying to find the points on two lines where the two lines are the closest. I've implemented the following method (Points and Vectors are as you'd expect, and a Line consists of a Point on the ...
2
votes
2answers
1k views
Weird rotation problem
I'm creating a simple tank game. No matter what I do, the turret keeps facing the target with it's side. I just can't figure out how to turn it 90 degrees in Y once so it faces it correctly. I've ...
2
votes
1answer
2k views
2d tank movement and turret solution
I'm making a simple top-down tank game on the ipad where the user controls the movement of the tank with the left "joystick" and the rotation of the turret with the right one. I've spent several hours ...
2
votes
1answer
3k views
Adding 2D vector movement with rotation applied
I am trying to apply a slight sine wave movement to objects that float around the screen to make them a little more interesting. I would like to apply this to the objects so that they oscillate from ...
6
votes
2answers
11k views
Moving a sprite in XNA/C#, using vectors
I'm currently looking into XNA game development with the C# language.
I have two classes: the main game handler and a "sprite" class. Following is some basic pseudo-code which I hope adequately ...
1
vote
1answer
260 views
Determining relative velocities on impact?
I'm trying to figure out a way to determine the relative velocity of a body colliding with another in a 2D environment.
For example if one body is moving at (1,0) and another traveling behind it ...
3
votes
2answers
6k views
Rotate vector by matrix?
If I have a Vector, say (1,1), how can I rotate it around the origin (0,0)?
I'm working in XNA if that helps.
3
votes
1answer
2k views
How do I find rotation in 3D based on a vector/normal?
I've been playing with Blender and Python, doing basic things like accessing vertices/normals,etc.
I can get the normal of each face of a mesh. I was wondering, how can I get the rotation of a face ...
3
votes
2answers
288 views
How do you transform a vector to use another objects orientation?
I want to take a vector that is using world coordinates and position it using the orientation of an object. So, if the direction of the object is the z-axis, and the vector is (0,0,1), then the ...
3
votes
4answers
2k views
Line triangle intersection - last bits
I'm doing line-triangle intersection. I have found the intersection point (vector) on the plane. All I need to do now is work out whether the point is inside the triangle it collided with (not the ...
3
votes
3answers
279 views
When to return a reference and when to return a copy?
I was looking at the d3dx math .h and noticed that a difference between the "+" and "+=" operators:
D3DXVECTOR3& operator += ( CONST D3DXVECTOR3& );
D3DXVECTOR3 operator + ( CONST ...
6
votes
2answers
908 views
For a 2D XNA game, should I use the built in Vector2 or Vector3 or port my own class from ActionScript?
I use a lot of 2D vectors in my Flash games - basically all velocities, positions etc I store in this way. My Vector2D class has lots of built in functions for rotation, dotproduct, projectOnto etc. ...
