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.

Filter by
Sorted by
Tagged with
2 votes
2 answers
141 views

everyone. I am working on a game that relies pretty substantially on "faking" 3D by using different parallaxing and polygonal transform techniques. In a current example, I am working on a ...
Peanut's user avatar
  • 21
1 vote
1 answer
129 views

I'm trying to determine the transformation steps (position, scale, rotation) needed to be applied to an object so that two points, locally positioned in that object, line up with two world space ...
Zeppelin's user avatar
1 vote
1 answer
581 views

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
  • 133
0 votes
1 answer
92 views

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

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

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

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

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

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
1 answer
153 views

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

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

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

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

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

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

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
0 votes
1 answer
257 views

I was watching this tutorial and at timestamp 3:03 he did this: This blows my mind because I didn't expect that to actually work, how the heck does that work ???? For example, if I have vector (2, 3, ...
pi squared's user avatar
0 votes
2 answers
145 views

In a FPS i'm trying to instantiate cube like the old good minecraft. The problem is that the first cube i instantiate on terrain got y=0 but half of that cube is underground ... All my cube prefab are ...
stighy's user avatar
  • 477
0 votes
1 answer
66 views

If I have an equation: |A×B|=A.B What would be the angle in between A and B?
Zie's user avatar
  • 1
0 votes
1 answer
114 views

Given a Vector2(x,y) that represents an object's velocity, like so: ...
CAOakley's user avatar
  • 101
0 votes
2 answers
459 views

Here's a list of math functions I'm having trouble finding a direct function match for in Godot C#: ...
Ethan's user avatar
  • 145
1 vote
1 answer
148 views

I'm creating a 3D twin-stick tank game in Godot with C#. I have created the tank movement and rotation, separate of its turret, and it seems to be working properly. The issue: I want the body of the ...
Reinier de Vries's user avatar
0 votes
1 answer
90 views

I have a piece of code similar to this: Vector2 test = new Vector2().setLength(20).setAngleDeg(45); But when I'm trying to print its contents (such as ...
big papa's user avatar
0 votes
2 answers
262 views

The game development library SFML has a Vector2 class template (and a Vector3 for that matter), which can use any arithmetic ...
JensB's user avatar
  • 157
1 vote
1 answer
2k views

The Context In Godot 4.1, I have a third-person character controller. It's a CharacterBody3D with a child Node3D called PlayerContent. The visual components of the character (model, etc.) are all ...
Legoman's user avatar
  • 173
2 votes
2 answers
334 views

I have a circle in 3D space, so we have center C with radius r, and the normal of plane the circle lies on, N. There is also a normalized vector V that I am modifying to go far past the circle's ...
A well-rested dog's user avatar
1 vote
1 answer
484 views

I'm trying to solve a lerp problem on my velocity, searched some stuff here and there, but found nothing that solved it. Can you help me? ...
Murilo Melo's user avatar
0 votes
1 answer
269 views

I want to know when to use InverseTransformDirection. Unity documentation says : "Transforms a direction from world space to local space". Honestly, it is not clear for me. I came across ...
Achie1's user avatar
  • 181
1 vote
1 answer
366 views

I'm trying to cast a ray so I can implement mouse picking. My game uses 2:1 isometric with a 3D world sim that uses AABBs. Positive X points to the bottom right, positive Y points to the bottom left, ...
Archduke's user avatar
0 votes
1 answer
63 views

Apologies for the bad title -- I have no idea how to explain this problem succinctly. I have two 3D vectors. One is the player's movement direction, and the other is the direction towards a wall they ...
Ryan's user avatar
  • 3
0 votes
0 answers
75 views

I'm trying to write a common 2D game and using vectors for physics. I have 1 wall and 1 player object that can move diagonally (both are squares without rotation). When the player object collides with ...
ZAK's user avatar
  • 1
0 votes
1 answer
378 views

I am doing a sort of hook, where whenever the hook collides with something, it retracts itself and pulls the the object it collided with back along with it. But the objects the hook can collide with ...
Fross's user avatar
  • 1
0 votes
1 answer
61 views

I'm trying to spawn infinite tiles in a 3D runner game, but the tiles are spawning at the wrong position and on the wrong axis. Technically, the code is working as it should, it is spawning and ...
Aj_Xocan's user avatar
1 vote
1 answer
317 views

I'm using unity3d to create a six-degree of freedom flying game. The game takes in input from a standard dual-stick gamepad (like the Logitech f310). In unity each of the gamepad's joystick's axes are ...
RhinoPak's user avatar
0 votes
1 answer
149 views

I've been stuck with this nightmare for a while, and it's certainly my perfectionism. What I have is a cannon that fires a shell from an object pool. The order of operations is as follows. The ...
Tyler Parker's user avatar
0 votes
0 answers
64 views

should i move everything by the windows Normalised cords to make it so SE is bottom-right, or should i use (1,1) and move everything at or either (1+speedX,1+speedY) ...
Domonicx's user avatar
0 votes
1 answer
118 views

I was making a 3rd person player controller in Unity. Would Vector3 inputDirection = orientation.forward * verticalInput + orientation.right * horizontalInput; be ...
Johnathan's user avatar
0 votes
0 answers
70 views

Related to this question How to project a Vector3 onto the xz plane? ...
mLstudent33's user avatar
1 vote
1 answer
1k views

I have this code that tries to check whether a lobbed grenade will head toward a teammate: ...
mLstudent33's user avatar
0 votes
1 answer
550 views

Ok, am I misunderstanding how Unity quaternions work, or is there a bad (about 2 degrees difference!) floating point error? The TLDR is I use a quaternion r to rotate vector v and put the result in w. ...
user1895149's user avatar
0 votes
1 answer
361 views

I'm working on an 3D insect/spider controller that will walk on any time of surface. Currently my character scan the environment around him by shooting a very big number of spherecasts and based on ...
Vasi's user avatar
  • 1
0 votes
2 answers
1k views

So I have created spaceship shooter game where ships have turrets on them . Now I want those turrets to shoot a moving target meaning I want the projectile to intercept and hit the target that is ...
GoldSpark's user avatar
1 vote
1 answer
1k views

I've been trying to make a function similar to "Find look at rotation" but with an offset. Imagine I have a pivot and an object attached to that pivot with some location and rotation offset. ...
Luka Glisic's user avatar
0 votes
1 answer
1k views

I have an assignment where they ask me to calculate Vector Right and Vector Up, it's for a camera creation using C++ and DirectX. For the Vector Right, they specify I should use 90-yaw, so I got: \$ ...
Nicoalejo's user avatar
0 votes
1 answer
3k views

I have some confusion that I need to be cleared up about the atan2 function. I am making a game in Godot where a 2D ship rotates to face some object in space by ...
GoldSpark's user avatar
0 votes
1 answer
1k views

I'm using vector3 as direction of object movement and i want to smoothly rotate it to another direction vector. I found SLERP but it rotate by percent. Looks like Vector3.RotateTowards is what i need, ...
notmychoice's user avatar
0 votes
1 answer
95 views

I have a space craft in a 3d world that moves along the X Z plane. Given that I have 4 thrusters with one at each cardinal direction, and the ship can rotate itself about the y axis. Is it possible to ...
Jeremy's user avatar
  • 15
1 vote
1 answer
248 views

Image attached below for clarification: So here we have a plane with a random rotation in 3D space, and we have the values for P1, P2, and the plane normal. How do I find the points X1 and X2? This ...
Pooper's user avatar
  • 23
-1 votes
1 answer
143 views

I'm trying to move my Character on the world's XYZ Axes, but how do I get them? I'm trying to do this because my Player is sort of a Sphere and is rolling around, so its xyz directions are rotating. I ...
Silwan's user avatar
  • 3
0 votes
0 answers
124 views

I was sent here by softwareengineering.stackexchange.com. I am writing a WinForms .NET application using C#. I use SkiaSharp for drawing for performance reasons. I can already create a cuboid, rotate ...
Birger's user avatar
  • 1

1
2 3 4 5
15