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.
1
vote
3answers
54 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 ...
1
vote
1answer
38 views
converting 2d grid of squares to polygon nav mesh
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 2D matrix of squares, all of the same size, some traversable and some ...
4
votes
2answers
65 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
61 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
98 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
149 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) ...
2
votes
1answer
69 views
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 articles like ...
2
votes
2answers
92 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
116 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 ...
1
vote
2answers
169 views
Rotate sphere in Javascript / three.js while moving on x/z axes
I have a sphere/ball in three.js which I want to "roll" arround on a x/z axis. For the z axe I could simply do this no matter what the current x and y rotation is:
sphere.roll_z = function(distance) ...
2
votes
4answers
205 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
153 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 ...
4
votes
2answers
229 views
Predictive firing (in a tile-based game)
I have a (turn-based) tile-based game, in which you can shoot at entities.
You can move around with mouse and keyboard, it's all tile-based, except that bullets move "freely".
I've got it all ...
4
votes
1answer
104 views
Algorithm to shoot at a target in a 3d game
For those of you remembering Descent Freespace it had a nice feature to help you aim at the enemy when shooting non-homing missiles or lasers: it showed a crosshair in front of the ship you chased ...
1
vote
2answers
86 views
How to offset particles from point of origin
Hi I'm having troubles off setting particles from a point of origin. I want my particles to spread out after a certain radius from a the point of origin. For example, this is what I have right now:
...