A mathematical concept that can be used to express position, direction or velocity and which can simplify or outright trivialise spatial problems.
1
vote
0answers
37 views
Quaternion to direction vector - flipping
I've kinda solved this myself by adapting the Camera::setDirection code from OGRE to work for my need:
Now I have the following code:
Vector3 boneDir = getBoneWorldOrientation(mEntity, mHips) * ...
4
votes
2answers
514 views
What is a good way to determine if a vector is between two other vectors?
I could operate with the angles, but I do not have the angles calculated yet (and would like to avoid having to do that). It would be possible to calculate and cache the local-coordinate-frame angles, ...
0
votes
1answer
49 views
XNA Creating a directional vector from two other vectors
Could somebody please tell me what I'm missing?
I have a scene where the camera is fixed in the sky looking down on a plane. On that plane is a 3D model. I want to move the 3D model in the direction ...
1
vote
1answer
285 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 ...
7
votes
4answers
494 views
How does normal mapping really work?
I'm trying to grasp the concept of normal mapping, but I'm confused by a few things. In short, I'm not sure whether a normal map is viewpoint dependent or not (i.e. whether you'll get a different ...
1
vote
2answers
104 views
Libgdx: Am I abusing Vector2? Is there a better way to do my position updates and rendering?
I'm simulating hair in a game. Currently I have a HairField object, which has a position defined by a Vector2. Each HairField has multiple Hair objects in a list, each with a position defined by a ...
-1
votes
2answers
69 views
JavaScript “Floats”, or ThreeJS wrong positioning? [closed]
I want to learn how to use Vectors with 3D.
Here is a strange Error I have encountered today.
Instead of stopping exactly on the other Cube, I get this:
When I change the IF to (cube.position.y ...
0
votes
0answers
54 views
Rotation of a car? [duplicate]
I am working on a game. I want to rotate enemies car so that they face the player car and move to approach it. I tried couples of techniques and algorithm but did not get fruitful results. I want to ...
2
votes
2answers
124 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 ...
12
votes
1answer
2k views
Determine arc-length of a Catmull-Rom spline
I have a path that is defined by a concatenation of Catmull-Rom splines. I use the static method Vector2.CatmullRom in XNA that allows for interpolation between points with a value going from 0 to 1.
...
0
votes
1answer
46 views
Rotating sprites
I'm a beginner at making games, i'm currently only working in 2D using XNA.
So far all of my games i've been using the following logic for sprite movement:
if(left key pressed)
sprite_x_position ...
3
votes
4answers
670 views
Is it better to track rotation with a vector or a float?
In XNA, you can see that to draw a rotated sprite with SpriteBatch, you'll need a float describing the angle in radians.
I'm used to making games in OpenGL. I just want a rapid prototyping ...
1
vote
4answers
129 views
How to smoothly rotate a vector in a direction?
I'm looking for an easy way to achieve the following:
Object A, B
{
Vector2D position;
Vector2D orientation;
}
update(elapsed)
{
//rotate A's orientation in B's direction by x * elapsed ...
0
votes
1answer
39 views
Sharp DX Identity Matrix, Matrix.Forward vector pointing at negative Z
I'm trying to take a steady grip on Sharp DX. Already done some work like translating, scaling and rotating objects. Now i have to calculate the rotation matrix using only direction vector and ...
-1
votes
0answers
33 views
How to unbind a sprite in an updating vector? LIBGDX framework [closed]
How to unbind an updating vector to a sprite? I am using Libgdx framework. here is my code
public class VectorSample extends GDX_TEST implements InputProcessor {
Texture ball,bullet,guider;
...
-1
votes
1answer
108 views
Optimization of Storage of Spells a Character Knows
I need to store which spells a character knows. While the game is executing I have them stored in a vector. Obviously storing this many values is either going to take a lot of computing to get the ...
7
votes
3answers
324 views
Collision detection problems using AABB's
I implemented a simple collision detection routine using AABB's between my main game sprite and various platforms (Please see code below). It works great, but I'm now introducing gravity to make my ...
4
votes
5answers
237 views
Implementing vector based movement in a 2d environment
Good evening.
I apologize if the title is a bit vague, I really could not come up with anything better.
I am currently reading a book called the nature of code and as a side project, I am working on ...
2
votes
6answers
1k 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
2answers
125 views
What kind of projection is ScreenX=X/Z, ScreenY=Y/Z?
I have an existing class which transforms 3D vectors and projects them on a 2D plane (Camera). The code is all written in C without help from an external library.
To project a single vector (X,Y,Z) ...
0
votes
2answers
145 views
Asteroids Movement
I have been making an asteroids clone, in C#. However, the ship's movement is... not quite right.
My plan is this: there is a speed, and two directions, namely the direction the ship is facing ...
0
votes
3answers
91 views
Keeping raycast on the same level
I want my raycast to end at certain height(red line). But as the game is 3D and the camera rotates I can't use a fixed magnitude. What I thought was a stroke of genius, I figured I'd project the ...
2
votes
1answer
59 views
front and back face detection
I am trying to implement a dynamic shadow system for a 2d game using this tutorial :
...
3
votes
3answers
292 views
Tetris - Rotations using Linear Algebra (Rotation Matrices)
I'm making Tetris in Java and am at the point of rotations... Originally I was hardcoding each rotation:
if (direction.equals("right")) {
if (shape.equals("Bar")) {
if ...
4
votes
2answers
151 views
Getting an angle in degrees from north
This may have been asked already, but I was unable to find it, because I don't really know what I'm looking for. I drew a picture:
I need theta. I've seen various solutions using Vector.Dot, and ...
5
votes
1answer
109 views
Rotating plane to be parallel to given normal via change of basis
I have two planes and their respective normals. I would like to rotate the second plane, planeB, so that it is parallel to the first, planeA.
To do this, I am using a change of basis to rotate each ...
2
votes
1answer
209 views
2D Top down acceleration vector
I have been wanting to solve the issue of movement once and for all... with all that I have learnt and read through, should be a piece of cake one would have thought... , seems it isn't. Having ...
19
votes
2answers
1k views
Calculating the rotational force of a 2D sprite
I am wondering if someone has an elegant way of calculating the following scenario.
I have an object of (n) number of squares, random shapes, but we will pretend they are all rectangles.
We are ...
4
votes
1answer
302 views
Why game engines usually don't offer a vector3.rotate method? [closed]
Game engines like Three.js, Ogre3d and Unity3d often don't provide a default rotate method on their vector class. You usually have to do something like:
rotated = vector.applyQuaternion(
new ...
4
votes
3answers
405 views
What are normal, tangent and binormal vectors and how are they used?
I would like to find out the following information:
What are they?
Example usage in game development (the area they are used in)
About the following vector types:
Normal
Tangent
Binormal
A ...
0
votes
0answers
57 views
Uses for vector projection?
My previous question was solved by vector projection. Thus I spent some time studying it (Few helpful links: Interactive projection, short video and a longer video.).
There were plenty of sites that ...
3
votes
3answers
230 views
Getting correct angles between Vector3s
I'm working on a project where you can draw lines between points. You select one point and drag the mouse onto another point and a line is drawn between them.
The line itself is a 3d object which is ...
1
vote
0answers
66 views
Rotate Points with Object in world space
I posted this in the original stack overflow then realized that a game-dev specific one exists.
I am working on personal project that requires me to have 4 points surrounding an object (1 at each of ...
2
votes
2answers
243 views
Why does handedness matter at all?
I'm really trying to understand this from a mathematical viewpoint. After all, numbers are numbers, the chirality or handedness depends on how one interprets it.
Say I've three basis vectors x (1, 0, ...
0
votes
1answer
126 views
Character movement relative to cursor position
I want my top-down shooter character to move towards the mouse when pressing the up arrow and strafe relative at right angles to it when pressing the left and right arrow keys.
I can't figure out how ...
0
votes
1answer
67 views
How to change Vectors due to change in it's dependent Base Vector?
PLOT :
I have been developing a game where the player falls down on Y axis and the camera is a Top-Down view camera. The camera, player (main character in the game) movements etc. have all been ...
1
vote
1answer
94 views
Movement constrained to the faces of a cube
The basic setup I'm working with is a cube rendered in-Engine (Panda3d, although I only am looking for a generalized solution) as well as a 2d square on one face of the cube. The eventual outcome I'm ...
2
votes
1answer
217 views
Shooting Bullets Around a Sphere
I currently have a ship that can orbit around a sphere freely controlled by a joystick. There is a separate joystick that controls the gun and starts shooting when it is touched.
Right now the ...
0
votes
4answers
159 views
How much to modify yaw? XNA 4.0 [duplicate]
Heres a picture that explains better than my words can
For rotating an object I'm using quaternions.
CreateFromAxisAngle(vector3.Right,yaw)
Maybe this isn't how I should be doing it but I also ...
1
vote
1answer
608 views
Bukkit shoot tnt & help with vectors
I want to shoot a piece of tnt from the players face and then let it explode when it hits the target block.
if (cmd.getName().equalsIgnoreCase("cannon")) {
...
7
votes
7answers
634 views
What's the best way of translating a 2D vector into the closest 8-way compass direction?
If you have a 2D vector expressed as x and y, what's a good way of translating that into the closest compass direction?
e.g.
x:+1, y:+1 => NE
x:0, y:+3 => N
x:+10, y:-2 => E // closest ...
3
votes
3answers
136 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 ...
2
votes
3answers
341 views
Oriented Bounding Box - How to?
I've been trying to write my own collision code, less because I want to, more because I want to understand its working.
To do this, i've been working off of the popular collision book i'm sure you've ...
8
votes
2answers
3k views
How do I linearly interpolate between two vectors?
I have a velocity vector where my client is at and where its going, and I have the same vector that comes from the server telling where the client should be. Sometimes its a bit different, so I want ...
0
votes
3answers
296 views
Lerp vs Vector math: one better than the other?
In Unity3D (all versions, I believe), there is a static function for the Vector3D class called "lerp". It interpolates a point between two points a point, based off a provided percentage related to ...
8
votes
3answers
460 views
Vector3 vs. Vector2 - performance, usage?
I'm currently playing around with XNA, and creating a simple 2D platformer. I was thinking of adding multiple layers to make it a little bit of challenge.
In stead of having a Vector2 for my ...
0
votes
1answer
124 views
Vector2's static methods and the garbage collector
I discovered that Vector2's static methods return a different Vector2 from the parameters you give them and I'm under the impression that creating new objects and dereferencing old ones on this kind ...
1
vote
1answer
93 views
Confusing with an articles wording on Clamping a Vector2
I have been reading an article on Collision Detection and how to resolve it.
http://www.wildbunny.co.uk/blog/2011/04/20/collision-detection-for-dummies/
In the section describing an AABB vs Circle, ...
1
vote
1answer
617 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). ...
-4
votes
2answers
160 views
enemy shooting towards FPS [closed]
WELL first of all I want you to see my game (its deployed on heroku cloud) :
http://still-escarpment-3701.herokuapp.com
(It takes almost 10 sec to load so please wait for couple of sec)
I have ...

