The linear-algebra tag has no wiki summary.
3
votes
0answers
30 views
Rotating plane to be parallel to given normal via change of basis
I have two planes and their respective normals. I would like to rotate the second plane, planeB, so that it is parallel to the first, planeA.
To do this, I am using a change of basis to rotate each ...
6
votes
2answers
231 views
How can you extract orientation from a transformation matrix?
I have a 4x4 transformation matrix M, and I want to find out the shape of a sphere when transformed by M. (Sphere is at the origin and has radius 1.)
I know I can find the center by just multiplying ...
1
vote
2answers
147 views
Matrix Rotation with three Angles
I want to rotate a form with three given angles fo each of the three axis. But the GLM rotation function takes only one angle and a vector as arguments.
How can I convert between both formats?
2
votes
0answers
91 views
Typical Applications of Linear System Solver in Game Developemnt
I am going to write a custom solver for linear system.
I would like to survey the typical problems involved the linear system solving in games. So that I can custom optimization on these problems ...
2
votes
0answers
108 views
Portal View/Projection Matrix near plane
For RenderToTexture/Camera based portal rendering, the basics seems simple enough.
However, with a free camera, most of the time it is going to be looking at such portals at an angle:
Now a ...
0
votes
1answer
94 views
Lerping to a center point while in motion
I have an enemy that initially flies in a circular motion, while facing away from the center point. This is how I achieve that:
position.Y = (float)(Math.Cos(timeAlive * MathHelper.PiOver4) * radius ...
1
vote
1answer
545 views
Raycasting Collision Detection
I need to check for collisions when firing a bullet, but I have a few questions first. My game is 2D and tile based, it also uses the XNA framework. From what I've read raycasting or continuous ...
0
votes
1answer
178 views
How to get xy coordinates along a given path
Say i have two points (x,y), (0,0) and (10,10). Now i wan´t to get coordinates along the line by stepping through values of x and y. I thought i solved it with the following functions:
fy = startY ...
6
votes
1answer
180 views
Matrices: Arrays or separate member variables?
I'm teaching myself 3D maths and in the process building my own rudimentary engine (of sorts). I was wondering what would be the best way to structure my matrix class. There are a few options:
...
0
votes
1answer
514 views
Trouble with Collada bones
I have a Collada file with a rigged mesh. I've read the node tags in the library_visual_scenes tag and extracted the matrix for each node and stored everything in a hierarchical bone structure. My ...
1
vote
2answers
434 views
XNA: How to Flip/Mirror a position over a custom vector?
I want to flip Horizontally my Sprite/Texture however the SpriteEffects.FlipHorizontally isn't cutting it for me as it just flips the texture in place.
I want to flip the texture over a specified ...
2
votes
1answer
2k views
Transform between two 3d cartesian coordinate systems
I'd like to know how to get the rotation matrix for the transformation from one cartesian coordinate system (X,Y,Z) to another one (X',Y',Z'). Both systems are defined with three orthogonal vectors as ...
5
votes
1answer
373 views
How can I calculate a vertex normal for a hard edge?
Here is a picture of a lovely polygon:
Circled is a vertex, and numbered are its adjacent faces. I have calculated the normals of those faces as such (not yet normalized, 0-indexed):
Vertex 1 ...
5
votes
2answers
2k views
How to detect 2D line on line collision?
I'm a flash actionscript game developer who is a bit backward with mathematics, though I find physics both interesting and cool.
For reference this is a similar game to the one I'm making: Untangled ...
11
votes
3answers
590 views
Biased, conservative random walk
I have a sprite which has Velocity and Position, either stored as Vector2. At each Update cycle, velocity is added to the position.
I would like to give the sprite a third vector, Target. New targets ...
2
votes
1answer
291 views
How to linearly transform vertices for large coordinate systems
Alright, so I'm working on a space game and well, I want it to have a lot of space! So I need a large coordinate system and for my rendering pipeline to not suffer from "vertex jittering" due to ...
7
votes
0answers
154 views
What is Direction Cosines applications in game development? [closed]
I am reading about direction of cosines which it seems to tie into change of axial system(transform of one coordinate system to another) and its just not clicking in my head. I don't know if its the ...
8
votes
2answers
689 views
How can I test if a point lies between two parallel lines?
In the game I'm designing there is a blast that shoots out from an origin point towards the direction of the mouse. The width of this blast is always going to be the same.
Along the bottom of the ...
2
votes
2answers
609 views
Dot Product Vs Cross Product Turning a Turret Towards A Enemy and firing
http://pastebin.com/iw9DHf7s is code demonstrating dot product turning a turretto a target and firing. It works and chooses best angle to spin.
A problem can occur when game goes faster (better ...
2
votes
4answers
889 views
What is an efficient 2D line-segment-versus-triangle intersection test?
In a 2D plane, I have a line segment (P0 and P1) and a triangle, defined by three points (t0, t1 and t2).
My goal is to test, as efficiently as possible ( in terms of computational time), whether the ...
1
vote
2answers
273 views
Learning C++, algorithms and vectorial algebra [closed]
I need your recommendations for a good study source about videogame orientated C++, algorithms and vectorial algebra.
I will be applying to a videogame programmer course in January so I need to start ...
3
votes
1answer
141 views
Make an object slide around an obstacle
I have path areas set up in a game I'm making for canvas/html5 and have got it working to keep the player within these areas. I have a function isOut(boundary, x, y) that returns true if the point is ...
3
votes
3answers
550 views
Equation to make small number big and big number small (gravity)
I have a sprite that I want to speed up as it gets closer to another object. I really want this to flow well and don't want a series of if statements. All I can think of is to take the distance and ...
-4
votes
3answers
866 views
How can I find a point on a line when I have only two other points?
I have a straight line passing from points A(2,-1) and B(4,5). I want to find a point C that is on the line and outside A-B.
1
vote
3answers
125 views
Finding which side one point is from another point
I have a simple question I think, if point a is to the right of another point I a dirx to be 1, otherwise -1. Likewise for a diry var, if it's above the other point I want it to be -1 otherwise 1. ...
4
votes
2answers
332 views
Enemy mathematical behavior
I'm really trying to up my game in game mathematics and now I'm working on enemy movement and a bit of AI. I have an enemy with two modes attack and avoid, based on an integer avoid variable that's ...
6
votes
4answers
822 views
How do I find the intersection of two lines
I have a bounding box on my character, its position in the previous frame an the current frame. The bounding box is axis aligned.
My character is running around inside a cave, I have a list of ...
7
votes
3answers
1k views
Rotating a vector by another vector in shader
I have a terrain surface with a normal for each point on the terrain.
I have a second detail normal map to be applied to the terrain.
These normals are in 3-space.
The Y value of both normals is
...
11
votes
6answers
3k views
Math topics for 3D graphics programming
I understand that the following math topics are required for 3D graphics programming. I have started doing some of them in my math course. Can someone point me in the direction of a resource that ...
1
vote
2answers
346 views
opengl rotations for a human
I currently can rotate around a pivot point by first translating to the pivot point then performing the rotation and finally translating back to the origin. I do that easily enough for the shoulder in ...
7
votes
4answers
574 views
Moving objects colliding when using unalligned collision avoidance (steering)
I'm having trouble with unaligned collision avoidance for what I think is a rare case. I have set two objects to move towards each other but with a slight offset, so one of the objects is moving ...
3
votes
1answer
706 views
Points on lines where the two lines are the closest together
I'm trying to find the points on two lines where the two lines are the closest. I've implemented the following method (Points and Vectors are as you'd expect, and a Line consists of a Point on the ...
3
votes
2answers
4k views
View matrix in opengl
Sorry for my clumsy question.
But I don't know where I am wrong at creating view matrix.
I have the following code:
createMatrix(vec4f(xAxis.x, xAxis.y, xAxis.z, dot(xAxis,eye)),
vec4f( ...
5
votes
1answer
2k views
Ray Intersecting Plane Formula in C++/DirectX
I'm developing a picking system that will use rays that intersect volumes and I'm having trouble with ray intersection versus a plane. I was able to figure out spheres fairly easily, but planes are ...
3
votes
4answers
2k views
Line triangle intersection - last bits
I'm doing line-triangle intersection. I have found the intersection point (vector) on the plane. All I need to do now is work out whether the point is inside the triangle it collided with (not the ...
4
votes
1answer
266 views
Line plane intersection: what is this variable?
I'm doing line plane intersection, and have come across an un-referenced variable or constant in the tutorial I'm following.
One of the formulae given is this:
t = N dot (p2 – p0)
...
7
votes
2answers
234 views
Draw land for motocross game
I would like to draw a land for a motocross game. I've been thinking of Bezier Curves but I am not sure whether this is the best approach. Can you give me some advice? I want to do it in JavaScript, ...
20
votes
6answers
2k views
What is a good linear algebra book for game programmers?
I was told that I should start learning Linear Algebra in order to create good games with good physics.
I'm reading Linear Algebra book and it's completely foreign to me. The author starts out with ...