# Tagged Questions

A mathematical concept that can be used to express position, direction or velocity and which can simplify or outright trivialise spatial problems.

448 views

### Confused about order of operation when using a Matrix in XNA, C#

Here are two different pieces of code This is what I started with Vector2 hold = Vector2.Transform(pos1, mat1); Matrix inv = Matrix.Invert(mat2); Vector2 pos2 = Vector2.Transform(hold, inv); And ...
3k 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")) { if(!perrmissionCheck(sender,...
677 views

### How to draw a line of a given length towards a given object?

I wanna draw a line between two moving objects I can't use: cDrawLine(startPointCG, endPointCG); because the line must have a length. So I'm trying to measure the angle between those two points ...
394 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 ...
640 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 D3DXVECTOR3&...
724 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?
429 views

### How do I find the 2D direction to a 3D location?

I'm writing a 3D space flightsim, and I'm trying to display a 2D arrow on screen that points to the player's selected target. To clarify, the arrow needs to point in the direction that the player has ...
2k views

### What is the camera direction vector for an isometric view?

What values correspond to a 3D vector for screen-normal from within an isometric game? It needs to be in game coordinates. It is a standard isometric where tiles are rotated 45 degrees and half ...
2k views

### Determining if something is on the right or left side of an object?

I have a character in a 3D world which is facing an arbitrary direction on a flat plane, the player can click on the left or right side of the character and based on which side is clicked on a ...
2k views

### Make objects follow a strict path (Xna)

I am making a defence game. Naturally, this means that there needs to be objects following a path on the screen. I want to make it a strict path from one point to another to another. I could use an ...
86 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 ...
364 views

### Spaceship acceleration for following waypoints

I'm creating a turn based space ship strategy game with simultaneous turn resolution similar to Steam Birds. After all the orders are given, the ships run through a real time simulation where they ...
574 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 ...
102 views

### Need the co-ordinates of innerPolygon

Let say I have this diagram, Given that i have all the co-ordinates of outer polygon and the distance between inner and outer polygon is d is also given. How to calculate the inner polygon co-...
96 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 ...
229 views

### How to calculate where specular highlights converge with an anisotropic shader?

If you look at a rendering with an anisotropic shader applied you will notice that there are special spots on the 3D surface/mesh where the lights seems to converge, a point where a given vector ...
148 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: ...
189 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 ...
4k views

### Vector images (SVG or other formats) support in libgdx or other Android framework? [closed]

I'm looking for a website to create games for Android. I'm interested in something that supports vector images. Do you know if libgdx supports them or is there a convenient way to use them in libgdx? ...
3k 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 ...
58 views

### Finding coordinate in radius

Hello i have two points (Vector3) A and B. And have a radius r How can i find a coords of point P in a circle by angle?
200 views

### Endless Running Game - Changing Lane Function in JAVA

I am developing a kind of vertical endless running game, where the character has 4 possible lanes to be in. I am using libGDX and want the character to change lanes by adding a horizontal velocity to ...
711 views

### Is there a quick way to determine if a vector is in a quadrant?

I am wondering if there is a quick easy way to determine if a given vector is in a specified quadrant. In the below image, I've define the ranges of the blue quadrants. For example, if I am given ...
237 views

### front and back face detection

I am trying to implement a dynamic shadow system for a 2d game using this tutorial : http://www.gamedev.net/page/reference/index.html/_/technical/graphics-programming-and-theory/dynamic-2d-soft-...
693 views

### what does AngleVectors method in quake 3 source code does

I just downloaded quake 3 for learning purposes. I know some of some linear algebra(basic vector math ie: dot,cross product). However I can't decipher what below method does, I know what is yaw,pitch ...
488 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 ...
144 views

### Vector math to calculate the rotation and drift of a tectonic plate?

I've been following the excellent Experilous procedural planet generation post, trying to recreate it in Java using libGDX. My planet is simpler, as it lacks any distortion of the mesh. It's just ...
579 views

### calculating torque from angular momentum considering inertia moment

so I am trying to determine exactly how much torque to apply to a 3d model to make it rotate at a particular rate. I apply force from the location of each engine on the craft so if one breaks the ...
143 views

### Edit spawn location according to vector direction

I'm trying to make a turret in Bukkit (Java). This will shoot an arrow to the players that are in the shooting radius. But now I've a little problem, the arrow gets stuck inside the block where its ...
1k views

### Spritekit - gradually apply force vector in different direction (space ship turning)

I have a space ship that I'm applying a force vector to using a joystick for control. I would like this to smoothly fly around when I'm switching directions.. Exactly like minisquadron if you've ...
3k views

### Orthographic Camera and Raycasting in Three.js

I'm working on a test project porting a simple game from iOS to Javascript. I've got the orthographic camera working and it can view the objects in the scene and move up and down the tower of meshes ...
4k 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 ...
419 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 it....
660 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 ...
380 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 ...
230 views

### Problems with Raycasting Requirements

Im working on a script which kinda works like an Enemy AI. Its kinda like a detection system with requirements that are required to be met. This is a recent question i asked using my code Raycast ...
381 views

### Controlling roll rotation when travelling along bezier curves

I am currently working on a curve implementation for use in Unity which includes an editor: The aim is to get an object to follow the path represented by the curve at a constant velocity. Currently ...
529 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, ...
2k views

### Check if the vector is behind another or maybe opposite directions?

I'm doing a network game and on the client side, i interpolate the client position with the server sent extrapolated position. The client has its own physics simulation wich is corrected by the server ...
1k views

### Vector normalization gives very imprecise results

When I normalize vectors I receive very strange results. The lengths of the normalized vectors range from 1.0 to almost 1.5. The functions are all written by me, but I just can't find a mistake in my ...
3k views

### convert orientation vec3 to a rotation matrix

I've got a normalized vec3 that represents an orientation. Each frame of animation, an object's orientation changes slightly, so I add a delta vector to the orientation vector and then normalize to ...
122 views

### How to convert non-discreate data for discreate pathfinding?

I have a list of entities that looks like [{x,y,width,height}, {x,y,width,height}, ...]. This list is non-discreate, It doesn't follow a grid. entities can be positioned at floats like x:2.345 Most ...
3k views

### Line Intersection from parametric equation

I'm sure this question has been asked before. However, I'm trying to connect the dots by translating an equation on paper into an actual function. I thought It would be interesting to ask here instead ...
2k 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. ...
5k views

### How to detect if object is moving in clockwise- or counterclockwise direction?

I've read this one, but I need more info: rotating an object from sourceAngle to destAngle, both 0-359, clockwise or counter clockwise? I have a ball. The user is able to drag the ball in any ...
1k views

### Why does my sprite jitter when it arrives at its destination?

I have just started looking into XNA for WP7 - and I am definitely the sort of person who likes to find answers to my questions without begging for help! I searched here to find an answer but I found ...
70 views

### How do I convert two vectors into a bounding box with 8 vertices?

I created two vectors named bboxmin and bboxmax using the functions vector3 applymin_xyz() and vector3 applymax_xyz(). How do I convert them to 8 vertices,so I can test cull with them?
726 views

### Min/Max of two vectors?

This seems like a simple question, but i'm having trouble searching the internet for it. In XNA, during a collision detecting method, I would determin the minimum of some vectors. // Get the minimum ...