Skip to main content

Questions tagged [vector]

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

1 vote
1 answer
484 views

Given two points (A and B), how can I obtain a point a set distance along the line between them?

Let's say I have position A, that is (0,0) and Position B that is (10,5). Now let's say I know that position C is 5 units' distance from position A in direction to Position B. Provided that the ...
user57129's user avatar
  • 131
0 votes
1 answer
54 views

Have enemy move toward player when spawned

Have an basic enemy prefab that when spawned, I would like it to lock to player and move toward them, with smooth rotation. However, as you can see in this video, the enemy initially moves away from ...
Anthony's user avatar
  • 11
3 votes
6 answers
2k views

How can I rotate a 16-bit signed integer vector?

I am trying to rotate a vector made of two signed 16-bit coordinates (-32768 to 32767). Using a LUT for sin/cos, I can use the standard method for rotating a vector: ...
IanLarson's user avatar
  • 811
0 votes
1 answer
70 views

Changing The Axis That Vector3.Slerp's Arc Happens On

I am using Vector3.Slerp to move a boomerang from the player to a target in an arc, and then back to the player. It's currently working, but not the way that I want it to. My issue is that I would ...
PayasoPrince's user avatar
0 votes
1 answer
44 views

Problem with 2D projection

I have a green circle: Inside the circle, the white frame moves to wherever P, the projection of the targets 3D position into a 2D point, is. However, outside the circle, the frame will move to the ...
KING MOOSE's user avatar
0 votes
1 answer
109 views

Rotate vector by quaternion different formulas

I was implementing the rotation of a 3D vector by a quaternion, implementing the formula that I've found in this thread. To testing my function, I've rotated some vectors by using MATLAB, in ...
Jepessen's user avatar
  • 101
0 votes
0 answers
57 views

Fast way to compare a large set of positions, rotations, velocities, etc. during runtime (possibly every frame)

The Goal I'm working on a vr gesture recognition system. Normally these systems are dependent on "drawn" gestures, but I want something that compares position, rotation, velocity, angular ...
Pen's user avatar
  • 13
0 votes
0 answers
48 views

How detect collision between object1[i] and object2[j] then do something with them in Box2D games?

I am making a simple game with Box2D and SDL2. I have GameObjects vectors for example: 1.vector of Enemy 2.vector of Bullets… in ContactListener class i can detect collision between enemyFixture and ...
Ryan Bairamzad's user avatar
0 votes
1 answer
105 views

Object collision and vector reflection for complex polygons?

I am currently creating an environment to train aim-bot AI's for my game. It is a 2d world made of complex polygons, and the goal is to have the AI's shoot ricocheting bullets. Using a ray-casting ...
Beluker's user avatar
0 votes
0 answers
295 views

Suspension vector direction of a raycast vehicle

I'm working on a raycast-based vehicle in a 3D world using a physics engine. It's basically a chassis object that contains a transform (translation, rotation, scale), a dynamic rigid body (with mass, ...
Splo's user avatar
  • 736
0 votes
1 answer
126 views

How to tell when calculating an Intercept Point between two moving objects, when it will never intercept?

I'm not a maths person and the formulas you see on maths type questions/answer with all the symbols is completely beyond me - I'm sorry. However I had help about 18 months ago to turn a provided ...
iOSProgrammingIsFun's user avatar
1 vote
1 answer
77 views

How to calculate rotation needed to cancel out perspective shift

I have a direction vector that's pointing to (0,0,1) in local object space. How can I calculate rotation needed to rotate it on Y axis so that from camera's point of view it would look as if it's ...
JuliusJ's user avatar
  • 13
2 votes
0 answers
102 views

Calculate Up Vector of Object on Surface Given Points and Normals

Context I want to find the up vector an object would have if it were leaning on a surface, given a large amount of points on that surface and their associated surface normals (i.e., an equation that ...
natSegOS's user avatar
1 vote
2 answers
207 views

Calculate path segments size

I have a problem more closely described on a picture below. The idea is that I have my agent in point A and I want to get to the point B. The problem is, that agents rotation towards point B is alpha ...
Peter's user avatar
  • 13
0 votes
0 answers
33 views

Getting 3D slide direction

I am trying to make my player slide down a curve (like a water slide) and so far I’ve managed to get the slide direction using the following code ...
Andrei Cristian's user avatar

15 30 50 per page
1
2 3 4 5
50