A mathematical concept that can be used to express position, direction or velocity and which can simplify or outright trivialise spatial problems.
1
vote
1answer
187 views
How to get a point to the left/right of a vector
I have a position vector of a point in space and a quaternion for it's rotation. What i'm trying to calculate is a point too the left and a point to the right.
I have the position and ...
3
votes
2answers
294 views
3D rotation matrices deform object while rotating
I'm writing a small 3D renderer (using an orthographic projection right now).
I've run into some trouble with my 3D rotation matrices. They seem to squeeze my 3D object (a box primitive) at certain ...
4
votes
1answer
1k 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
vote
1answer
339 views
how can i get rotation vector from matrix4x4 in xna?
i want to get rotation vector from matrix to realize some parent-children system for models.
Matrix bonePos = link.Bone.Transform * World;
Matrix m = Matrix.CreateTranslation(link.Offset)
* ...
3
votes
3answers
134 views
Determining a point that reached another point
I have two points, one is moving and one is stationary. I would like to know if the moving point has reached that point or not. I tried to calculate the distance between two vectors and the distance ...
3
votes
1answer
98 views
How to make an object stay relative to another object
In the following example there is a guy and a boat. They have both a position, orientation and velocity.
The guy is standing on the shore and would like to board. He changes his position so he is ...
1
vote
2answers
149 views
Billboarding + aligning with velocity direction
I'm working on a particle system where I'm orientating the billboard using the inverted orientation matrix of my camera. This works quite well and my quad are rotated correctly towards the camera.
...
7
votes
2answers
408 views
Rotate a vector
I want my first-person camera to smoothly change its viewing direction from direction d1 to direction d2. The latter direction is indicated by a target position t2.
So far I have implemented a ...
0
votes
0answers
235 views
C++ Directx 11 D3DXVECTOR3 doesn't allow me to devide it [closed]
If i have a simple vector3 like this:
D3DXVECTOR3 inversevector = D3DXVECTOR3( (pos+lookat_pos));
It works perfect!
But let's say i wanted to multiply it by:
Speed*(float) timeHandler.GetDelta()
...
5
votes
1answer
194 views
Moving in a diamond - enemy gets stuck
I have an enemy that I would like to move as follows:
Start at (0, 200, 0)
Move to (200, 0, 0)
Move to (0, -200, 0)
Move to (-200, 0, 0)
Move to start point, repeat as long as it remains active.
...
-1
votes
4answers
136 views
What is a good starting project to get up to speed with vectors and vector math? [closed]
I have been getting into games programming recently. However, all I have made so far (in order) is Snake, Breakout and Tetris.
I want to take on a bigger project, and some research has led me to ...
3
votes
1answer
206 views
How do I implement a selectable world map?
I want to have a selectable map of the world, preferably zoomable, in a cocos2d project. When I tap on a country, I want that country to be selected so that I can perform some other operations with ...
1
vote
1answer
460 views
Rotate triangle so that its tip points in the direction of the point on the screen that we last touched
OpenGL ES - Android.
Hello all, I am unable to rotate the triangle accordingly in such a way that its tip always points to my finger.
What i did : Constructed a triangle in by GL.GL_TRIANGLES. Added ...
1
vote
1answer
460 views
Unity: parallel vectors and cross product, how to compare vectors
I read this post explaining a method to understand if the angle between 2 given vectors and the normal to the plane described by them, is clockwise or anticlockwise:
public static AngleDir ...
1
vote
1answer
182 views
Viewport.Unproject - Checking if a model intersects a large sprite
Let's say I have a sprite, drawn like this:
spriteBatch.Draw(levelCannons[i].texture, levelCannons[i].position, null, alpha, levelCannons[i].rotation, Vector2.Zero, scale, SpriteEffects.None, 0);
...
3
votes
1answer
191 views
Limit rotation heading by cone/angle
What is a fast way of limiting the heading vector to a certain angle so that it turns in greater distance relative to the limit.
A smaller cone/angle should make the object take a far bigger curve to ...
2
votes
1answer
280 views
android game-logic for shooter
Im creating a 2d game for android.
I'll just get right to it. I have a sprite controlled by a joystick that needs to shoot, sofar Ive managed to get direction and movement on my bullet, but then I ...
0
votes
1answer
118 views
Is it safe to cast my 2D points to 3D points for a library which only takes Vector3s?
I need to cast a ray in 2D space for bullet collision detection, but the Ray.Intersects method requires a BoundingBox which uses vector3's not vector2's. My question is should I just ignore the Z ...
0
votes
2answers
479 views
Calculating angle between two vectors to steer towards a target
I have been trying to implement a path following steering behaviour for AI in a 2D racing game.
I have two vectors:
futurePosition represents the predicted future position given the car's current ...
2
votes
2answers
377 views
android 2d bullet-spawn (shooting)
This will be a quick question since Im pretty sure I'm overlooking something small that I for some reason cant see.
My sprite is moved using a joystick, and I want my sprite to be able to shoot. I've ...
1
vote
1answer
270 views
Ball bouncing at a certain angle and efficiency computations
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
1answer
168 views
XNA Framework sprite vectors and also scaling
I'm working on making my first Pong game with XNA Framework 4.0. Right now i've put 2 pong paddles and a ball (they have separate classes). In the "Paddle" class i've made a function that returns a ...
1
vote
1answer
756 views
Vector movement in space type game (Mouse rotation)
I'm having an issue with my movement in my 'game' prototype. It's basically not working and admittedly my knowledge with vectors is lacking.
The issue I'm running into is that the ship won't move in ...
2
votes
6answers
976 views
How to implement object velocity as a vector
I'm working on a Breakout game, and want to change the ball's movement code from how I currently do it, to something based on vectors (as I feel learning and implementing movement based on vectors ...
3
votes
1answer
269 views
How to bounce a 2d point particle off of a circular edge
In a prototype I'm building, a particle can spawn anywhere within a larger, confining circle. Important to note is that the particle will not spawn in the origin of the larger circle, but anywhere ...
3
votes
5answers
715 views
Normalization of Vectors: Return a copy of the result or alter the object itself?
When calculating the normal of a vector, which is considered canon:
Returning a copy:
Vector2D Vector2D::Normalize() const {
double a1 = GetX();
double a2 = GetY();
double a3 = GetZ();
...
0
votes
3answers
231 views
Parent-Child position mathematics
What is the math theory when a child object moves with the parent transform?
I am doing an angle indicator which shows a field of view, which works fantastic when the angle is static. But I cannot ...
0
votes
2answers
248 views
3D Vector “End Point” Calculation for procedural Vector Graphics
Alright, So I need some help with some Vector Math.
I've developing some game Engines that have Procedural Fractal Generation for Some Graphics, such as using Lindenmayer Systems for generating Trees ...
3
votes
1answer
291 views
Finding closest object to a location within a specific perpendicular distance to direction vector
I have a location and a direction vector indicating facing, I want to find the closest object to that location that is within some tolerance distance (perpendicular distance) to the ray formed by the ...
2
votes
2answers
132 views
How can I move a polygon edge 1 unit away from the center?
Let's say I have a polygon class that is represented by a list of vector classes as vertices, like so:
var Vector = function(x, y) { this.x = x; this.y = y; },
Polygon = function(vectors) { ...
0
votes
1answer
213 views
C++ and SDL Trouble Creating a STL Vector of a Game Object
I am trying to create a Space Invaders clone using C++ and SDL. The problem I am having is in trying to create Waves of Enemies. I am trying to model this by making my Waves a vector of 8 Enemy ...
2
votes
1answer
234 views
Detect if square in grid is within a diamond shape
So I have a game in which basically everything is a square inside a big grid. It's easy to check if a square is inside a box whose center is another square:
*** x
*o* --> x is not in o's ...
1
vote
0answers
243 views
Calculate initial velocity of a 3d vector-based projectile
Okay, so I got a Projectile with 2 Vectors, position and velocity.
I now want to calculate the initial velocity for it in order to reach a specific point on the map.
Or actually, how high has the ...
5
votes
3answers
614 views
Split a 2D scene in layers or have a z coordinate
I am in the process of writing a 2D game engine, and a dilemma emerged. Let me explain the situation...
I have a Scene class, to which various objects can be added (Drawable, ParticleEmitter, ...
2
votes
1answer
214 views
Transform 3D vectors between coordinate systems
I've got 6 points in 3D space: A,B,C,D,E,F, that represent 4 vectors. AB is perpendicular to AC and DE is perpendicular to DF.
I need to find a transformation matrix M, that transforms AB to DE and ...
-2
votes
2answers
299 views
Calc direction vector based on destination vector and distance from enemy in AS3
I'm working on a zombie game in AS3 where I want a character to be able to move away from a zombie depending upon how close the zombie is. The character also has a destination that it's trying to get ...
1
vote
1answer
319 views
Trouble with SAT style vector projection in C#/XNA
Simply put I'm having a hard time working out how to work with XNA's Vector2 types while maintaining spatial considerations. I'm working with separating axis theorem and trying to project vectors onto ...
1
vote
1answer
400 views
Transform 3d viewport vector to 2d vector
I am playing around with 3d transformations and came along an issue.
I have a 3d vector already within the viewport and need to transform it to a 2d vector. (let's say my screen is 10x10)
Does that ...
2
votes
2answers
510 views
Smooth vector based jump
I started working on Wolfire's mathematics tutorials. I got the jumping working well using a step by step system, where you press a button and the cube moves to the next point on the jumping curve.
...
0
votes
1answer
251 views
Vector reflect problem
I'm testing some vector reflection and I want to check what happens when
a ball collides with a paddle.
So if I have:
Vector2 velocity = new Vector2(-5, 2);
position_ball += velocity;
if ...
1
vote
1answer
604 views
Interpolation between two 3D points?
I'm working with some splines which define a path a character follows (you can see a gameplay video here to get a better understanding of what's going on: http://www.youtube.com/watch?v=BndobjOiZ6g). ...
8
votes
2answers
889 views
How do I determine if one polygon completely contains another?
I have 2 polygons. I know the vertex coordinates of both polygons. What's the best way to check if one is completely inside the other? For example, the algorithm should only recognize the black ...
0
votes
2answers
437 views
Rotate point by a direction vector
Given a vector, A, which represents a point, and a unit vector, B, which represents the looking direction, how would I rotate A so that B is the axis that's looked down on? Let's say the looking-axis ...
2
votes
1answer
196 views
Moving Unit Parallel to Mouse in TBS Game
I'm writing a basic Turn-Based Strategy game using Unity3D. It's not grid-based. I've come to the point where I'm coding unit movement, and I'm having trouble figuring out how far to move the units ...
0
votes
1answer
262 views
Determining and culling non-visible vertices
Ahoy!
After posting my previous question on tile maps, i've been tinkering with an implementation i'm rather pleased with so far but would like to gather some more information about submitting ...
-1
votes
1answer
139 views
Find a Rectangle by coordinates - XNA
I have 2 coordinates (X,Y). I have also a 10x10 array. By these coordinates I have to find the rectangle in which is my pointer at the moment.
How could I handle it?
2
votes
4answers
1k views
Most effective way to manage a gamestate system that is easy to use?
I just started working on my game, mostly the game management. I plan and using game-states to make the menu's and other stuff easier.
My main idea for implementing the game-states is creating a game ...
0
votes
0answers
107 views
Vector Class Mutex String Is Missing [closed]
UPDATE After going over all my code, the updating code was pointing to the wrong variable which made it null. It works now, very good may I add, thanks for anyone who took the time.
I have a C++ ...
0
votes
3answers
241 views
How would I successfully split a vector to increase game performance?
Okay so I have a vector for all of the monsters that are spawned in my game. All of these monsters are in a single vector and are "active" according to what zone they are in relative to the player's ...
2
votes
1answer
233 views
multiply matrix by vector: what to do if need to change y-up to z-up?
I multiply a matrix with a position vector to get a new position, however, now I need to change my matrix from y-up coordinate space to z-up. Changing only the matrix won't work: how to apply the ...


