The tag has no wiki summary.

learn more… | top users | synonyms (1)

0
votes
0answers
65 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 ...
1
vote
2answers
95 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 / ...
1
vote
1answer
164 views

Gerstner wave function simplified?

The gerstner wave function is a commonly used method to calculate waves and simulate water in video games and movies or most 3d simulations. It is however quite complex so it is very hard for young ...
1
vote
1answer
222 views

3d Water Simulation formula questions

I have created a Grid: At each point along the grid, is a vertex (Intersection Points): Each of these points has an x,y,z position. Vector3f(x,y,z). In an attempt to animate the grid into a group ...
-1
votes
3answers
396 views

Move player to mouse click

Im hopelessly not good at algebra and such. But im trying to learn. I want to learn and understand how to use it in game programming rather than modifying snippets or using classes that do it for me. ...
2
votes
2answers
89 views

Angle between two planes

I have two triangles in 3d space which share 1 edge and I would like to determine if the angle between their normal vectors is "uphill" or "downhill". In other words, if you set one flat, would the ...
-1
votes
1answer
77 views

Can not seem to adjust the speed of my Car

I'm programming in C++, rendering in OpenGL and using GLM for matrix/vector manipulation and I have implemented very (very) basic car controls; ignoring many forces that are present in reality. Since ...
1
vote
1answer
673 views

Basic Car Movement, Converting 2D Vectors to 3D problems

I'm trying to follow this guys method for steering a basic car. Link. It's the first example I can sort of get my head around and I'm trying to convert it to a working 3D version. To get some scope, ...
0
votes
0answers
55 views

Using Angles (or rotation) with Vectors for Car physics

I've been reading this blog that explains basic linear algebra for game developers and I understand the basics of vector mathematics. I'm using vectors to create a car that simulates the very basic ...
0
votes
1answer
82 views

Using versors for movement

The context I was thinking of using a versor + velocity field to implement the "moving" part of a 2D game object. For example, if the player should move right I just set the versor to be: [1, 0] and ...
1
vote
1answer
281 views

shadow mapping and linear depth

I'm implementing ominidirectional shadow mapping for point lights. I want to use a linear depth which will be stored in the color textures (cube map). A program will contain two filtering techniques: ...
3
votes
1answer
105 views

How to calculate where specular highlights converge with an anisotropic shader?

If you look at a rendering with an anisotropic shader applied you will notice that there are special spots on the 3D surface/mesh where the lights seems to converge, a point where a given vector ...
2
votes
1answer
217 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 = {} ...
5
votes
1answer
139 views

Vector Math question

Suppose I have two game object located at two Vector3s v1 and v2, respectively. If I wanted to locate a position between v1 ad v2, but 3 units away from v2, how would I manage that in terms of ...
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 ...
2
votes
1answer
147 views

Optimising skeletal animation

I am implementing a skeleton system for my latest game. I am using my own linear algebra classes which already have some optimisations, such as separate transformPoint and transformVector functions ...
-1
votes
2answers
115 views

JavaScript “Floats”, or ThreeJS wrong positioning? [closed]

I want to learn how to use Vectors with 3D. Here is a strange Error I have encountered today. Instead of stopping exactly on the other Cube, I get this: When I change the IF to (cube.position.y ...
-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 ...
2
votes
2answers
189 views

Java Tetris - Matrix Rotations

I'm building Tetris in Java and am trying to use linear algebra to rotate a piece composed of 4 tiles. My friend was explaining the way to do it is: He said: "To clarify, you do need to rotate ...
3
votes
3answers
782 views

Tetris - Rotations using Linear Algebra (Rotation Matrices)

I'm making Tetris in Java and am at the point of rotations... Originally I was hardcoding each rotation: if (direction.equals("right")) { if (shape.equals("Bar")) { if ...
0
votes
2answers
127 views

How to rotate one object around another moving object in 3-d?

i was wondering if anyone could give me some advice on how to rotate one object around another moving object. After a bit of googling i found some code on another website that worked perfectly but it ...
5
votes
1answer
248 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 ...
7
votes
2answers
824 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 = ...
1
vote
2answers
608 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?
4
votes
1answer
893 views

Raycasting tutorial / vector math question

I'm checking out this nice raycasting tutorial at http://lodev.org/cgtutor/raycasting.html and have a probably very simple math question. In the DDA algorithm I'm having trouble understanding the ...
2
votes
0answers
119 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
112 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 ...
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 ...
1
vote
1answer
2k 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
130 views

Is it safe to cast my 2D points to 3D points for a library which only takes Vector3s?

I need to cast a ray in 2D space for bullet collision detection, but the Ray.Intersects method requires a BoundingBox which uses vector3's not vector2's. My question is should I just ignore the Z ...
0
votes
1answer
924 views

Finding the normal from one 3d vector/line to any point on another 3d vector/line

Say I have two 3d vectors, v1 and v2 (you can consider them both lines if you like). I'm trying to figure out a normal for v1 so that it intersects along any point of v2. I keep drawing blanks on ...
0
votes
1answer
311 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
218 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
1k 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 ...
0
votes
2answers
450 views

Vectors from matrix

In XNA you can get front/back/left/right vector of Matrix class. How get these vectors without XNA, through C++ using standart 4x4 matrix ? I dont understand what exactly they mean but found them very ...
1
vote
2answers
841 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
6k 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
464 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
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
725 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 ...
12
votes
3answers
764 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
398 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
182 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
1k 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
985 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 ...
1
vote
2answers
332 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 ...