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.
7
votes
0answers
60 views
Accounting for waves when doing planar reflections
I've been studying Nvidia's examples from the SDK, in particular the Island11 project and I've found something curious about a piece of HLSL code which corrects the reflections up and down depending ...
4
votes
3answers
80 views
Propel entities at some angle (depending on explosion's position)
I have a 2D platformer. There are multiple particles that are just 1x1 colored pixels. Let's assume there are 256 particles laid out as a 16x16 cube. Say I popped an explosion right in the middle. All ...
0
votes
1answer
74 views
Rotate around the centre of the screen
I want my camera to rotate around the centre of screen and I'm not sure how to achieve that. I have a rotation in the camera but I'm not sure what its rotating around. (I think it might be rotating ...
1
vote
1answer
29 views
Picking problem with rotated view matrix
I have picking code that works, if my view matrix has no rotation (only translation). Now If I rotate my camera, picking goes to hell.
I cant find whats wrong
My code:
...
1
vote
0answers
47 views
Determining axis to rotate around
I'm trying to implement a free-look third person camera (using glm). I know that the general transformation is
newCameraPosition = translate(lookatPoint) * rotation(angle,axis) * ...
1
vote
2answers
117 views
Rotating sprite 180 deg
I should say first, that I have the rotation down. Its just that I want my square to rotate exactly 180 degrees. Currently, it will rotate but it will rotate but by less each jump. So after several ...
2
votes
1answer
71 views
The math behind Variance Shadow Maps - moments
I am not asking how to implement them (that's not particularly difficult), but I'm having a bit of trouble understanding why the moments used in Chebyshev's inequality (indirectly) are equal to the ...
-1
votes
0answers
41 views
odd man out rules for a 9 boxes having 1 odd man [closed]
i'm building a html game , in which i have 9 boxes showing some sort of sequences of images in which i have to find the odd one pattern and click on that box,..i want rules to generate those patterns ...
1
vote
1answer
70 views
How do I find the circumcenter of a triangle in 3D?
I want to find the circumcenter of a triangle. Wolfram only shows how to find the circumcircle of a triangle in R2. How can I find the circumcenter of a triangle in R3?
1
vote
1answer
71 views
Designing a four-directional movement control
I'm developing an RPG for iOS. Currently, I plan my controls to look like this:
So the user can interact with objects, people, etc. by tapping on the right side of the screen, and moves by swiping ...
3
votes
1answer
76 views
Symmetry preserving path simplification
I'm using the Douglas peucker (DP) algorithm to simplify some (2d) closed paths forming a shape. This works pretty good, but not so much for closed paths that have some symmetry. Take for example a ...
7
votes
1answer
139 views
How do I get the areas enclosed by an arbitrary 2D shape?
In my game I want users to be able to draw arbitrary 2D shapes of any length around game objects. The shapes must be closed and drawn with a single stroke that does not overlap.
For example:
I ...
1
vote
0answers
80 views
Rotate a point in 3D space with sine and cosine
I got my camera controlled by the mouse. Now I want a sphere to be always in the center of my view(just for testing). I tried that by assigning the sine of the Y rotation of the camera times 10 as the ...
3
votes
1answer
120 views
Collision detection in games in 3D - edge to edge cross product
I am having trouble understanding why, in a game collision detection, separating axis determination requires checking for the cross product of edges of the two polytopes as additional potential ...
-1
votes
1answer
47 views
Trouble figuring out some attack/defense formulas. What should I change? [duplicate]
I'm working on something which requires a hunter to attack an animal. This is what I have so far.
Attacker/Weapon POV
Level - 1 to 50
Base - base attack level of the weapon
Weapon Impact - ...