0
votes
0answers
59 views

Closest distance from 3D point to vector line

First let's have a look at my little drawing: I have an origin point p1 defined by x, y and z co-ordinates, and a vector v given by x, y and z magnitude. I also have an arbitrary point, p2, given ...
1
vote
1answer
100 views

Unity: Rolling a ball around a spherical planet with forces

I'm trying to make a game in Unity where the player character is a ball (a sphere), and the game world is a planet (a very large sphere) that the ball can roll around on. The ball can be rolled in any ...
0
votes
0answers
90 views

How to rotate a line in 3d space?

I am trying to figure out direction vectors of the arrowheads of an arrow. Basically I'm given a normalized direction vector (u,v,w) and I need the normalized direction vectors of the its two arrow ...
0
votes
1answer
47 views

Getting the position of a directional light w.r.t. a moving object.

I have a forward vector of my object, which is a bike, and its position, and I have a directional light direction. I would like to know where the light is with regards to the bike ...
0
votes
1answer
58 views

How to modify normal vectors with a tranformation matrix

Transformation is quite simple when it comes to Position or Color of the vertex, for Position just multiply matrix * vector and for color just don't do anything, but my question now is: How to handle ...
3
votes
4answers
256 views

Why not use vectors to represent orientation?

From what I've read, people mostly use either quaternions or 3x3 matrices to represent 3D orientations, while plain vectors are used for angular velocity/momentum. Since we can use vectors to ...
1
vote
2answers
411 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 ...
2
votes
1answer
237 views

How to correctly represent a bone system?

I'm currently representing my bone system as follows, in pseudocode: root = {} root.rot = v3(0,0,0) root.pos = v3(0,0,0) function create_child(parent,rot,length): child_bone = {} ...
2
votes
3answers
1k views

How to find the entity I'm looking at?

I am currently making a mod for Minecraft but I have come to a stop because I am lacking in some knowledge. I need to get data for the entity I am looking at, which I believe requires the use vectors, ...
2
votes
2answers
343 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, ...
1
vote
1answer
113 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 ...
-4
votes
2answers
197 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 ...
2
votes
1answer
253 views

Turning to face mouse

Given three points on the same Y plane; A ship A point along the ships heading A mouse cursor How can I find which direction and angle the mouse cursor is from the ships heading? I have a limited ...
3
votes
2answers
432 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 ...
3
votes
3answers
169 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 ...
1
vote
1answer
249 views

Viewport.Unproject - Checking if a model intersects a large sprite

Let's say I have a sprite, drawn like this: spriteBatch.Draw(levelCannons[i].texture, levelCannons[i].position, null, alpha, levelCannons[i].rotation, Vector2.Zero, scale, SpriteEffects.None, 0); ...
3
votes
1answer
378 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 ...
2
votes
1answer
306 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 ...
1
vote
1answer
484 views

Transform 3d viewport vector to 2d vector

I am playing around with 3d transformations and came along an issue. I have a 3d vector already within the viewport and need to transform it to a 2d vector. (let's say my screen is 10x10) Does that ...
0
votes
2answers
664 views

Rotate point by a direction vector

Given a vector, A, which represents a point, and a unit vector, B, which represents the looking direction, how would I rotate A so that B is the axis that's looked down on? Let's say the looking-axis ...
2
votes
1answer
379 views

multiply matrix by vector: what to do if need to change y-up to z-up?

I multiply a matrix with a position vector to get a new position, however, now I need to change my matrix from y-up coordinate space to z-up. Changing only the matrix won't work: how to apply the ...
7
votes
1answer
2k views

How do I calculate collision response between a sphere and a plane?

I'm trying to create a simple 3D game and need to constrain the player within the limits of the game world. When the player hits the sides of the world I want the player's ship to bounce off slightly. ...
6
votes
2answers
1k views

Vector games (Wireframe, Elite-like) theory and implementations?

I'm interesting in knowing more about how vector games like Elite and Star Wars Atari were built from grounds up. The question is not how to implement vector graphics with modern 3D APIs like OpenGL ...
1
vote
1answer
196 views

Mesh to world vector translation

Suppose I have a world defined in typical OpenGL coords.. then the up vector defined for this space is (0,1,0). Now, if I load a model that is defined with (0,0,1) as its up vector, what are the ...
9
votes
4answers
373 views

What exactly causes a surface to overlap another?

I cannot really figure out what causes one surface to overlap another. In a 3D engine I'm creating, my technique is failing in edge cases. My method is sorting the surfaces to be painted from the ...
2
votes
1answer
486 views

Calculate the initial velocity of a 3D trajectory

I've got a 2D projectile code sample working, but would like to extend it to 3D. How would I calculate the initial velocity of the Z-axis? At the moment, I've got: initVel.X = (float)Math.Cos(45.0); ...