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
30 views

Why can't CSS Sprites handle vectors?

Almost all the documentation available either says that "sprites are bitmaps" or that "css sprites must be bitmaps". Is there a specific reason for this? Is it, in fact possible to create a css sprite ...
1
vote
1answer
27 views

Unity 5: Would Raycast suffice?

Hello game development pros! I need help with some logic in my script. I created a dynamic day/night cycle that works fine in itself, but lately I've been wanting to add a game clock that works off ...
0
votes
0answers
39 views

how to move an object to the mouse in Java

I have just recently started using Java, literally 2 days ago, and I have run into an issue. While I have been easily able to figure out most of the syntax and methods, because I have used multiple ...
1
vote
2answers
74 views

Malformed/Pixelated Vertex Normals

I am trying to generate vertex normals for a given triangles/vertices list with the following code: **BASE METHOD:** private void CalculateNormals() { for (Int32 i = 0; i < m_Meshes.Count; ...
1
vote
1answer
35 views

Unable to achieve two finger panning

I'm looking to achieve a two finger smooth pan system in my project. However, the code below does not work, any interaction with the screen doesn't change to position of the camera. I am unsure where ...
-2
votes
0answers
21 views

Clamping camera and smooth pan back to target.transform?

I'm looking to have a camera move horizontally, but clamped on the other two axis. Also, I would like, during the horizontal panning, for the camera to have a short delay before smoothly fixating back ...
0
votes
1answer
29 views

Unable to stop navmeshagent for rotation before moving

I'm trying to get the NavMeshAgent to rotate before calculating a path and proceed walking. I stumbled upon a thread that said this can be done by manually rotating the object first. However, I am ...
0
votes
1answer
17 views

Unable to get object to rotate to looked position?

I'm trying to get an object to smoothly rotate towards a clicked point in my terrain. However, my code only yields jittery movements in the other direction. Any help will be greatly appreciated. ...
0
votes
1answer
67 views

Working but flawed bullet spread (vector math)

I'm trying to implement random bullet spread into my game, and I've managed something that works, but is consistently flawed. The spread doesn't vary depending on the distance the mouse is from the ...
1
vote
1answer
36 views

Rotate an objects velocity

I have a collision system (in 3D but for the purpose of the question assume 2D) where I want to calculate the new velocity (stored as a vector) after a collision. What I have is the velocity of the ...
1
vote
1answer
46 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?
0
votes
1answer
48 views

Controlling the movement of player by sprite using Mouse

I want to move the player by pressing down on the mouse and moving around by dragging. The player won't move to the position of the mouse. Instead it should be relative to the players current ...
-2
votes
2answers
45 views

In XNA, how do I make a sprite move towards another?

I am making a shoot-em-up with a player-controlled sprite with a gun: I have most of the game working, but I have gotten to the point where I need to load in the enemy characters and make them move ...
3
votes
1answer
74 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 ...
0
votes
3answers
70 views

How to check distance between two different vectors?

So I have a very basic racing game, where I would like the car to stop once it hits the finish line. Respectively when the distance between the car and the finish line hits or goes under 0 the car ...
1
vote
0answers
34 views

Find camera coordinate of vanishing point

Given a vector and a camera (position, angle, up vector, field of view, etc), how would I find the vanishing point of the vector in camera space?
2
votes
1answer
63 views

How to prevent bullets from passing right through entities?

(sorry for bad english) I'm making 2D arcade game. I write all of physics stuff myself. The problem involves bullet behaviour. Imagine bullet flying towards some entity. If the bullet's velocity is ...
0
votes
1answer
41 views

Resultant Vector Of Circle Line Collision

For my game I need to have a circle collide against a wall and bounce off in the appropriate direction. I've looked around for a while and haven't found a good solution to my problem. I have a diagram ...
0
votes
0answers
14 views

Screen coordinates to letterboxed view

So I have letter boxing working properly (it's not really important but I'll post that bit of code too), but I'm trying to figure out the point/vector arithmetic for translating (projecting) screen ...
4
votes
1answer
285 views

Does vector transformation order matter?

Theoretical question - imagine a car object. There are two (or more) 'forces' acting on this car, these forces will affect where the car will steer. But the forces are calculated using car's location ...
0
votes
1answer
79 views

How do I rotate a cube around an axis, relative to the camera view?

I want to be able to rotate a cube, either by dragging vertically to rotate it around the Y-axis, or dragging horizontally to rotate it around the X-axis. However, when the camera is rotated 90 ...
7
votes
2answers
587 views

In Unity, why is adding a Vector2 and a Vector3 ambiguous but assigning isn't?

Given the following two vectors: Vector3 v3 = Vector3.one; Vector2 v2 = Vector2.one; This line is ambiguous: v3 += v2; // Unity reports dimension ambiguity whilst this assignment isn't: v3 = ...
0
votes
1answer
113 views

Unity forward vector flips when upside down. Mario Galaxy style gravity, bad rotation?

This is a question that I think is best to explain visually, so I will do my best to be succinct here. What I am trying to do: Allow the player to run about a world that is spherical, not a flat ...
1
vote
2answers
61 views

How can I calculate the orthographic projection needed to encompass an object with arbitrary rotation?

So I need to set up the dimensions of a orthographic projection that will encompass the entirety of a bounding box when viewed from any arbitrary position. That's an eye (programmer art); and the ...
0
votes
0answers
85 views

Kinect wrist yaw angle calculation

I am trying to calculate the wrist yaw for the Kinect. However i don't know enough from Vector algebra to be able to find these correctly. Currently i have been using the following code to hopefully ...
0
votes
1answer
32 views

Making a ordered list iterator [closed]

Noob here, I am trying to display a list of a vector with ascending numbers. To display the list I iterate through the following code. cout << "\nYour games list is: \n"; for (iter = ...
0
votes
4answers
71 views

How do I figure out if a point is infront or behind my vehicle?

I need to figure out whether a point is infront or behind my vehicle. I have the vector of it's position, forward direction. So far I have tried finding the vector perpendicular to its forward ...
1
vote
1answer
53 views

LibGDX/Java - Trying to find the vector from one object to another

I want to add springs in my game that work like the ones in sonic - i.e. if you can't get over an obstacle you have to hit a spring which sends the main character flying towards another spring that ...
1
vote
1answer
229 views

Estimate the time it takes for an object to travel from point A to point B

I have an object with vec2 position, velocity, and destination with 2 variables maxspeed and acceleration. In each step, its position is calculated as follows: vec2 desiredVel = destination - ...
0
votes
2answers
80 views

Need some help with math steering behavior stopping on destination point

I have implemented a movement system based on steering behaviors: http://gamedevelopment.tutsplus.com/series/understanding-steering-behaviors--gamedev-12732 where each object has vec2 position, ...
3
votes
5answers
267 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 ...
0
votes
2answers
134 views

Vector3.Angle() Never Reaching 0

I'm having trouble understanding why with this script, Vector3.Angle() sometimes will never reach 0. This question comes from me trying to make a "turret" that rotates to face a target position. It ...
0
votes
2answers
110 views

2D indicator for Rotation in 3D space

This is the view from my spaceship. It can move around in 3d space and turn up, down, left and right. The planet Earth on the top right is selected. Now I want to create the red arrow to always ...
1
vote
1answer
570 views

How to rotate an object to face another in Unity?

I'm having an issue where I can't seem to rotate my bullet appropriately whenever I spawn one. I currently have a capsule prefab I am testing with. I spawn it with the following code. ...
0
votes
0answers
79 views

Steering problem in 2d game

I am creating a little 2D non tiled top down game. The enemy uses steering behaviour for chasing player or wandering around, but I do not think my code is working as it should be. My problem is, the ...
0
votes
1answer
50 views

Dragging an object and moving it back to it's original position on release?

I'm making a small game, and I'm trying to add this mechanic where if you click on an object and move it, then you release the object it will snap back to it's original position. Currently, each ...
0
votes
1answer
55 views

Pygame 2D Vector Math Mouse Input

The following code is supposed to move a player sprite (in this case it's an 8x8 red square) to the coordinates of where the mouse is clicked. I'm able to move the square in the general direction of ...
-1
votes
1answer
41 views

how to determine wall direction with information of normal and incoming direction

what is formula ( and theory behind) used to determine wall direction with only knowing the normal of wall and incoming direction object. in this thread example :Collision detection - Smooth wall ...
0
votes
1answer
167 views

Controlling roll rotation when travelling along bezier curves [Unity3D]

I am currently working on implementing 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 ...
1
vote
1answer
101 views

Averaging normals, or tangents

I am using a library to load an obj but it doest compute the tangets for each vertex, which I need for normal mapping and pom. I computed my tangets, and bitangents, everything appears to be fine, but ...
1
vote
3answers
422 views

Create random polygon shapes

I want to make a random shape made out of points. I want the points to create a polygon shape. Is there a clever way to create a random shape like this? Im thinking going throug X points and giving ...
0
votes
0answers
82 views

Matrix, vector multiplications in OpenTK

I developed a 3d model viewer in c++ with OpenGL, and in c# in OpenTK. Both are using the same shader, but the output from OpenTK is not correct. I read that OpenTK is row major order, and OpenGL is ...
0
votes
1answer
96 views

Calculate slope for linear interpolated movement

I want to move rectangles to their targets the "smooth" way with linear interpolation. I hope this is right. float slope(float x1, float x2, float y1, float y2) { return std::abs((y2 - y1)) / ...
1
vote
1answer
38 views

Vector magnitude in orientation

First, a quick overview of my problem: I have a game entity which has a quaternion to represent its rotation/orientation. It also has a 3D vector in world space for its linear velocity. From the ...
0
votes
1answer
172 views

Vector-based Pong-ball bounce calculations

I'm making a 2D game with pads and balls, sort of like Pong, in Unity 4.6.1. The calculations, however, won't be (very) Unity-specific. The pads are going to appear in various rotations, and therefore ...
0
votes
1answer
146 views

How do I calculate the bounce vector of a ball hitting the starting point of a segment?

I have a ball (with parameters x, y, radius) that travels on the screen (with vectors directionX directionY) and can collide with a segment with random slope (with parameters startX, startY, stopX, ...
6
votes
3answers
366 views

How can I check if a player-drawn line follows a path?

I want to draw an invisible path that the user must follow. I've stored that path as points. When a player draws a line, how can I test if it follows the path I've stored? Here's an example for ...
1
vote
1answer
137 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 ...
0
votes
0answers
53 views

Ray casting: need to find start and end vectors

So I have a 3D object and I'm trying to implement Maximum Intensity Projection on it. I already started of using a default vector to show per pixel, namely: pixelCoord[0] = uVec[0] * (i - ...
0
votes
1answer
124 views

Raycast Flashing problem

Can anyone tell me what is wrong with me code ? If you can see, whenever the player is in range of the raycast. The enemy turns red. But for some reason. Even when the player has meet the requirement ...