Arithmetic, geometry, calculus, and all else which resolves the number-crunching necessary in a game. Math questions are those that deal with the formulae and calculations used by the game in various parts.
2
votes
2answers
103 views
Getting to math applications gradually
I'm currently getting a formal degree related to computation, in particular my current focus is numerical programming, scientific computing and machine learning. I'd love to apply that knowledge in ...
0
votes
1answer
116 views
Y Axis inverted on vertex output
I've got my project running and somehow it seems my vertex y components are inverted. 10 in the positive on Y goes down and 10 negative on the Y axis goes up.
I can't find anything with the ...
2
votes
0answers
99 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 ...
1
vote
0answers
87 views
Numerically stable(ish) method of getting Y-intercept of mouse position?
I'm trying to unproject the mouse position to get the position on the X-Z plane of a ray cast from the mouse. The camera is fully controllable by the user. Right now, the algorithm I'm using is...
...
3
votes
1answer
256 views
Spherical to Cartesian Coordinates
Well I'm reading the Frank's Luna DirectX10 book and, while I'm trying to understand the first demo, I found something that's not very clear at least for me. In the updateScene method, when I press A, ...
1
vote
2answers
587 views
Line Intersection from parametric equation
I'm sure this question has been asked before. However, I'm trying to connect the dots by translating an equation on paper into an actual function. I thought It would be interesting to ask here instead ...
0
votes
1answer
103 views
Build a view frustum from angles
I have 4 angles, left, right, top & bottom. These angles are in degrees. They define the angle between the forward vector and the corresponding side. I am trying to use these to calculate the ...
0
votes
1answer
101 views
Rotate/Translate object in local space
I am just trying to create a movementcontroller class for game entities. These class should transform the entity affected by the mouse and keyboard input. I am able to calculate the changed rotation ...
12
votes
1answer
195 views
Orthographic unit translation mismatch on grid (e.g. 64 pixels translates incorrectly)
I am looking for some insight into a small problem with unit translations on a grid.
Update and Solved
I solved my own issue. See below for details. Everything in this part of the post turned out to ...
-2
votes
1answer
154 views
Move projectile in direction the gun is facing [duplicate]
Possible Duplicate:
Move sprite in the direction it is facing?
I am attempting to have a projectile follow the direction a gun is facing. When using the following code I am unable to make ...
4
votes
1answer
117 views
How to transform mesh components?
I am attempting to transform the components of a mesh directly using a 4x4 matrix. This is working for the vertex positions, but it is not working for the normals (and probably not the tangents ...
0
votes
1answer
88 views
Using NumPy arrays as 2D mathematical vectors?
Right now I'm using lists as position, velocity, and acceleration vectors in my game. Is that a better option than using NumPy's arrays (not the standard library's) as vectors (with float data ...
15
votes
7answers
520 views
Do I need a Point and a Vector object? Or just using a Vector object to represent a Point is ok?
Structuring the components of an engine that I am developing along with a friend (learning purposes), I came to this doubt.
Initially we had a Point constructor, like the following:
var Point = ...
4
votes
1answer
440 views
Re-create 2D side-on wave effect from Worms game
I'm trying to recreate the waves/water effect from Worms ( see here http://youtu.be/S6lrRqst9Z4?t=31s ) From what I understand its not actually a sprite, its procedurally generated by something like a ...
1
vote
1answer
209 views
Point inside Oriented Bounding Box?
I have an OBB2D class based on SAT.
This is my point in OBB method:
public boolean pointInside(float x, float y)
{
float newy = (float) (Math.sin(angle) * (y - center.y) + Math.cos(angle) *
...
1
vote
2answers
95 views
Logarithmic spacing of FFT subbands
I'm trying to do the examples within the GameDev.net Beat Detection article ( http://archive.gamedev.net/archive/reference/programming/features/beatdetection/index.html ) I have no issue with ...
1
vote
2answers
116 views
Determining if something is on the right or left side of an object?
I have a character in a 3D world which is facing an arbitrary direction on a flat plane, the player can click on the left or right side of the character and based on which side is clicked on a ...
3
votes
1answer
234 views
Understanding normal maps on terrain
I'm having trouble understanding some of the math behind normal map textures even though I've got it to work using borrowed code, I want to understand it.
I have a terrain based on a heightmap. I'm ...
0
votes
1answer
144 views
Tilting towards turn direction (for a motorbike)
I have a motorbike which moves along based on a direction vector, I set its forward direction to the direction it's moving.
What I'd like to also do with it is have the motorcycle tilt in the ...
0
votes
1answer
112 views
Camera lookAt target changes when rotating parent node
have the following issue.I have a camera with lookAt method which works fine.I have a parent node to which I parent the camera.If I rotate the parent node while keeping the camera lookAt the target , ...
0
votes
0answers
57 views
Calculating the position of an object with regards to current position using OpenGL like matrices
i have a 1st person camera that collides with walls, i also have a small sphere in front of my camera denoted by the camera position plus the distance ahead. I cannot get the postion of the sphere but ...
16
votes
2answers
563 views
Eight or infinity sign trajectory
When I want to move object around point I do:
point.x *= cosf(timer.timeElapsed);
point.y *= sinf(timer.timeElapsed);
How to make point move on eight or infinity sign trajectory?
-1
votes
2answers
171 views
What kind of math should I be expecting in advanced programming? [duplicate]
Possible Duplicate:
What math should all game programmers know?
And I don't mean just space shooters and such, because in non-3D environments it's obvious that not much beyond elementary ...
0
votes
1answer
162 views
Normalizing the direction to check if able to move
i have a a room with 4 walls along the x and z axis respectively. My player who is in first person (therefore the camera) should have collision detection with these walls. I'm relatively new to this ...
2
votes
0answers
135 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
125 views
Characteristics, what's the inverse of (x*(x+1))/2? [closed]
In my game you can spend points to upgrade characteristics. Each characteristic has a formula like:
A) out = in :
for one point spent, one pont gained (you spend 1 point on Force so your force goes ...
39
votes
4answers
775 views
How to determine which thrusters to turn on to rotate the ship?
The configuration of the ship changes dynamically, so I have to determine which thruster to turn on when I want to rotate the ship clockwise or counter clockwise. The thrusters are always axis aligned ...
2
votes
2answers
104 views
setting the position in different resolution
I have a normal game window which is 640*480, and everything is fine, but when I try to maximize the window, the objects translate to different positions on the screen, for example If I have a circle ...
0
votes
1answer
68 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
2answers
96 views
How do I apply a force using the object direction and speed?
I have a 3D object moving and I need to be able to apply forces to it such as gravity. In 2D, I would simply store its movement in dx and dy, but since this is in 3D, I am using a Vector3D direction ...
2
votes
0answers
101 views
Initial direction of intersection between two moving vehicles? [duplicate]
Possible Duplicate:
Predicting enemy position in order to have an object lead its target
I'm working with a bit of projectile prediction for my AI and I'm looking for some ideas, any input?
...
1
vote
2answers
225 views
Confusion about Rotation matrices from Euler Angles
I am trying to learn more about Euler Angles so as to help myself in understanding how I can control my camera better in the game.
I came across the following formula that converts Euler Angles to ...
1
vote
1answer
185 views
How to get a point to the left/right of a vector
I have a position vector of a point in space and a quaternion for it's rotation. What i'm trying to calculate is a point too the left and a point to the right.
I have the position and ...
2
votes
2answers
369 views
Quaternion based rotation and pivot position
I can't figure out how to perform matrix rotation using Quaternion while taking into account pivot position in OpenGL.What I am currently getting is rotation of the object around some point in the ...
5
votes
1answer
491 views
Why doesn't Unity's OnCollisionEnter give me surface normals, and what's the most reliable way to get them?
Unity's on collision event gives you a Collision object that gives you some information about the collision that happened (including a list of ContactPoints with hit normals).
But what you don't get ...
3
votes
2answers
287 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
134 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 ...
0
votes
1answer
373 views
Building View Matrix in Direct3D11
Am I doing it right? I converted this.
m_ViewMatrix = XMMatrixLookAtLH(XMLoadFloat3(&m_Position), lookAtVector, upVector);
to this one.
XMVECTOR vz = XMVector3Normalize( lookAtVector - ...
2
votes
3answers
191 views
How to adjust position relative to resolutions?
I have a lot of objects on the screen and would like at different resolutions, object's positions rendered correctly on the screen irrespective of the resolution. Is it correct to multiply the ...
5
votes
2answers
326 views
How can I generate a navigation mesh for a tile grid?
I haven't actually started programming for this one yet, but I wanted to see how I would go about doing this anyway.
Say I have a grid of tiles, all of the same size, some traversable and some not. ...
3
votes
2answers
142 views
how to calculate intersection time and place of multiple moving arcs
I have rocks orbiting moons, moons orbiting planets, planets orbiting suns, and suns orbiting black holes, and the current system could have many many layers of orbitage.
the position of any object ...
1
vote
2answers
147 views
Billboarding + aligning with velocity direction
I'm working on a particle system where I'm orientating the billboard using the inverted orientation matrix of my camera. This works quite well and my quad are rotated correctly towards the camera.
...
1
vote
2answers
107 views
ricocheting off a wall
I have a capsule (sphere sweep) that I've computed the collision on a mesh with.
I know the point of impact and normal of the face it collides with.
My moving object - I'm using a capsule to ...
1
vote
3answers
276 views
(int) Math.floor(x / TILESIZE) or just (int) (x / TILESIZE)
I have a Array that stores my map data and my Tiles are 64X64. Sometimes I need to convert from pixels to units of tiles. So I was doing:
int x
int y
public void myFunction()
{
getTile((int) ...
5
votes
3answers
765 views
Is it possible to map mouse coordinates to isometric tiles with this coordinate system?
I'm trying to implement mouse interaction in a 2D isometric game, but I'm not sure if it's possible given the coordinate system used for tile maps in the game.
I've read some helpful things like ...
2
votes
2answers
237 views
Rotating a child shape relative to its parent's orientation
When rotating a shape using a quaternion value I also wish rotate its child shape.
The parent and child shapes both start with different orientations but their relative orientations should always be ...
6
votes
1answer
214 views
How can I get a 2D texture to rotate like a compass in XNA?
I'm working on a small maze puzzle game and I'm trying to add a compass to make it somewhat easier for the player to find their way around the maze. The problem is: I'm using XNA's draw method to ...
2
votes
2answers
1k views
Rotate sphere in Javascript / three.js while moving along x/z plane
I have a sphere/ball in three.js which I want to "roll" around on the x/z plane. For the z axis I could simply do this no matter what the current x and y rotation is:
sphere.roll_z = ...
2
votes
4answers
564 views
Simulating a sine wave/oscillating pattern for enemies
I'm creating a simple top down shooter, right now I have an enemy which simply follows the player. I'd like to change things up and have the enemies move towards the player but in a wave like motion. ...
4
votes
3answers
242 views
How to get distance from point to line with distinction between side of line?
I'm making a 2d racing game. I'm taking the nice standard approach of having a set of points defining the center of the track and detecting whether the car is off the track by detecting its distance ...
