1
vote
2answers
90 views

How can I get a direction vector from a an Euler angle?

Im trying to get a directional vector from an euler angle. But im not getting how to do it. This is what i got so far. escapeAngle += 90; var radians = escapeAngle * (Mathf.PI / ...
2
votes
1answer
89 views

Getting half plane direction relative from cam position

Im implementing certain Camera movements in my turn based games. I'm able to place and rotate the camera between two units that attack each other. However it will always move to the same "side". Which ...
-5
votes
2answers
101 views

Should I negate a variable or use absolute value? [closed]

this is how i was chaning ball postion if(...) //if ball goes to left of screen dx = -dx if(...) //if ball goes right of screen dx = -dx; i found some people using math.abs to move ball ...
7
votes
2answers
817 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 ...
2
votes
2answers
257 views

2D field of view detection inverted

I'm not sure if the title matches what I'm actually facing I'm trying to test if I can see a point is in my field of view (in the context of an NPC seeing in it's direction.) I know that: cos0 = ...
2
votes
0answers
118 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
172 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
80 views

Vector transform equation explanation

I'm trying to understand the maths of moving points in a 3d space by making a game written in C#. I'm looking at this wolfire blog series which explains some basic 3d maths. I've read the first two ...
6
votes
1answer
217 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: ...
1
vote
2answers
839 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 ...
5
votes
2answers
4k 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 ...
6
votes
3answers
723 views

For normal mapping, why can we not simply add the tangent normal to the surface normal?

I am looking at implementing bump mapping (which in all implementations I have seen is really normal mapping), and so far all I have read says that to do this, we create a matrix to convert from ...
2
votes
1answer
397 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 ...
2
votes
2answers
984 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 ...
0
votes
1answer
90 views

Finding the angle of a line given 2 other lines

I'm trying to implement some 2D vehicle physics. For this to work I have 2 wheels attached to the body of the car. After doing some collisions checks I place the wheels at their new position. Say the ...
2
votes
4answers
2k 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 ...
3
votes
1answer
166 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
1k 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 ...
-5
votes
3answers
1k 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
126 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. ...
7
votes
3answers
2k 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 ...
12
votes
6answers
4k 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 ...
6
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 ...
4
votes
1answer
302 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) ...
20
votes
6answers
3k 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 ...