Questions tagged [mathematics]

Mathematics questions deal with the arithmetic, geometry, calculus, formulae and other calculations used in the development of a game.

Filter by
Sorted by
Tagged with
16
votes
6answers
15k views

What is the purpose of the canonical view volume?

I'm currently learning OpenGL and haven't been able to find an answer to this question. After the projection matrix is applied to the view space, the view space is "normalized" so that all the points ...
20
votes
4answers
3k views

Calculating the output of two armies fighting

I am programming a strategic game using Flash. The game works very similar to the famous game "Travian". My problem is as follows: I am trying to make the calculation of the troops lost as a result ...
2
votes
2answers
242 views

I'm trying to learn the "digital physics" required to do a floating network of spheres

If that is even what it is called. What I am trying to do it: http://asterisq.com/products/constellation/roamer/demo Can someone please point me to towards a book or in vaguely the right direction? ...
3
votes
2answers
520 views

When constructing an orientation matrix, are the rows of the matrix the axis?

When constructing an orientation matrix, are the rows of the matrix the axis? The matrix is row-major and I'm multiplying vectors on the right (Mv). So, the matrix looks like ...
6
votes
1answer
10k views

How do I find rotation in 3D based on a vector/normal?

I've been playing with Blender and Python, doing basic things like accessing vertices/normals,etc. I can get the normal of each face of a mesh. I was wondering, how can I get the rotation of a face ...
3
votes
2answers
347 views

How do you transform a vector to use another objects orientation?

I want to take a vector that is using world coordinates and position it using the orientation of an object. So, if the direction of the object is the z-axis, and the vector is (0,0,1), then the ...
27
votes
4answers
18k views

Bezier curve arc length

See also: same question on Math.SE How can I find the arclength of a Bezier curve? For example, a linear Bezier curve has the length: ...
9
votes
3answers
1k views

Calculating Experience Points earned after a battle

I'm developing a simple text battle game and having some issues calculating how much XP should be earned after a battle, theres a few factors that i want to consider: 1) Players should of course earn ...
7
votes
2answers
3k views

Implementing 2D CSG (for collision shapes)?

Are there any simple (or well documented) algorithms for basic CSG operations on 2D polygons? I'm looking for a way to 'add' a number of overlapping 2D collision shapes. These may be convex or ...
4
votes
1answer
377 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)      N dot V The ...
2
votes
1answer
596 views

Problem with arcball

I making graphics viewer, and I want to use "arcball" to manipulate object. I using OpenGL + CML ( for math ). My arcball don't want work, it is skewing not rotating :/ And I don't know why, I use ...
6
votes
7answers
30k views

Does a minor in math increase my hirability? [closed]

I've been pondering this question for some months now, and have been unable to get an answer from anyone in the industry (likely because I know no one in the industry). I am currently completing a B....
6
votes
4answers
406 views

How would one generate a texture for cracks in different materials?

I would want to have the ability to simulate different variables like brittleness, or other variables to get varied end results. I would mainly need to generate impact cracks, so it would need to ...
6
votes
3answers
1k views

Determining the probability of a successful attack based on the equipped weapon?

Take this example, a player has a sword composed of the handle and a blade. Together, they generate a strength of X and that combination adds qualitative attributes (induce more damage to fire ...
60
votes
9answers
18k views

Moving ships between two planets along a bezier, missing some equations for acceleration

OK, I already posted this over at math.stackechange.com but didn't get any answers :( First of here's a picture of my problem, the description follows afterwards: So I got all the points and ...
1
vote
5answers
2k views

How can I make my score-based game addictive?

I need some ideas to make players interested in the game result. Otherwise, the player plays again to get high score. My game is a calculation game that measures the speed of calculations that the ...
3
votes
3answers
1k views

Generating background tiles for a side-scroller with variable player speed

I'm currently working on a side-scroller which lets the player alter their speed and I wondered how should I properly generate and control background tiles for such a kind o game. I'm using Flixel but ...
3
votes
1answer
316 views

Correct Blitting 2 surface problem

this is a graphics/math problem. Consider this 2 sprite / surface As you can see they are a tank and his gun turret. Now, i manage the turret rotation, and it works, and, also, the rotation of the ...
16
votes
3answers
851 views

Building a Plattformer - How to determine if a player is allowed to jump?

I'm building a simple Plattformer Jump n' Run Style game. I do not use tiles - instead i've geometrical shapes for my level entities (and the player is one too). I finished my collision detection code ...
26
votes
6answers
19k views

How can you visualize a quaternion?

When I visualise a three dimensional rotation matrix, or scaling matrix I visualize it as three axes. Is there a similar way that I can visualize a rotation quaternion?
25
votes
3answers
13k views

Is there a faster sine function?

I am working on generation 3d perlin noise. The C# Math library seems like overkill for what I need since most of its functions use double percision. I use Math.Sin() in several places to generate the ...
12
votes
4answers
7k views

How do I implement deceleration?

I say "deceleration" because I'm not using acceleration at the moment; what I mean is moving the velocity back towards zero, eventually stopping. I'm new to vectors and not so great with physics and ...
5
votes
1answer
2k views

Local to World coordinates in 2D and back

I'm getting back into hobby game programming after a long 4-year hiatus from college and I find that my understanding of coordinate systems is somewhat lacking. I'm trying my skills at creating a ...
7
votes
3answers
6k views

How to smoothly let an object move along a curved line

I'm wondering how to move objects, with rotation taken into account, to follow a curved line see: http://www.youtube.com/watch?v=iPpO24FeAX4 for an example In particular I wonder: how to store the ...
33
votes
13answers
46k views

Comparing angles and working out the difference

I want to compare angles and get an idea of the distance between them. For this application, I'm working in degrees, but it would also work for radians and grads. The problem with angles is that they ...
22
votes
6answers
11k views

What is a good linear algebra book for game programmers? [closed]

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 ...
33
votes
11answers
78k views

In Pong, how do you calculate the ball's direction when it bounces off the paddle?

I'm trying to wrap my head around this very Hello World-y problem in game development. I've created a TicTacToe game in XNA so I guess the next step would be a Breakout clone. Keep in mind that I ...
11
votes
2answers
6k views

Float, double or both for 2D Vector class?

I'm currently writing a small cross-platform OpenGL-based 2D game engine for our studio. When I researched which 2D Vector class to use, I stumbled across three different design paradigms: Float &...
5
votes
2answers
1k views

Zooming and panning a camera simultaneously causes a swooping effect

In a 2d game, I have a basic camera class. The guts of the class creates a transformation matrix that is later passed to the Begin() method of a SpriteBatch. The transformation is done like this: <...
11
votes
2answers
4k views

How to make the player slide smoothly against terrain

I'm making an isometric game. When the player tries to walk diagonally into a wall I want them to slide smoothly across it, so whatever portion of the movement would be legal is used, and anything in ...
4
votes
4answers
2k views

How to find two perpendicular lines given a single plane

Hey guys, i was wondering how i would go about finding the perpendicular lines relative to a surface normal. For instance say i have (0,0,1) the expected output would be (1,0,0) and (0,1,0). What ...
6
votes
2answers
3k views

How to think about 2D scaling/rotation transformations

This is a kind of embarassing question to me since I'm getting more in-depth with XNA but some times my way of thinking about things in my head contradicts an example and I need to re-think it to make ...
2
votes
1answer
282 views

Can someone provide a simple algorithm for calculating an outcome based on User characteristics?

In these online games, say you are a person who has characteristics like: level strength experience defense ... And now you walk into a room of 'others' that you want to e.g. recruit, how would you ...
4
votes
2answers
1k views

A good place to learn about Game Programming with Mathematical Vectors? [closed]

I am looking for a place in the web where I can turn my current game development process into a vector based approach. I am sorry If this question has been asked once. According to my google search ...
1
vote
1answer
373 views

What kind of game is prisonblock? Any open source that I can learn the math behind it?

What kind of game is prisonblock? Any open source that I can learn the math behind it for user actions/gameplay?
2
votes
1answer
435 views

Why isn't my world coordinate mapping back to the proper local coordinate?

I'm using XNA and am having a simple issue which I can't figure out. I'm just messing around and want to get a firm grasp of local/world space coordinates. ...
3
votes
2answers
558 views

Methods to 'cull check' polys in OpenGL

A quick search through the web suggests there's quite a few methods of potentially detecting back-culled faces on the CPU. The purpose of the check is to evaluate whether to performing other ...
8
votes
3answers
1k views

How does one separate the acceleration due to gravity from other motion in accelerometer input?

How does one separate the acceleration due to gravity from other motion in accelerometer input?
0
votes
1answer
240 views

Combine n Gaussian Probability Sets in a limited float range

I've got a fixed solution space defined by a minimum and maximum float which has no divisible slice. You then have 0..N Gaussian distribution probability sets which I need to combine. In the end I ...
5
votes
2answers
465 views

Is there a better way of determining direction to turn?

You have an entity A that you want to turn towards another entity B. One way to determine the direction to turn is to compute the cross-product of the direction vector of A with the vector from AB. ...
15
votes
4answers
4k views

How do I calculate rotation caused by bounce friction?

Following on from my previous question: I have the ball quite realistically bouncing from surfaces it hits. Now I'd like to make it spin from the friction of the hit. Showing this is simple enough: I ...
12
votes
3answers
4k views

What are the most common splines you will find in game development?

List here the most common splines found in game development, how many points the method needs to interpolate a curve, and how can you build a data type that allows you to get an interpolation of the ...
6
votes
2answers
3k views

How to calculate the exit speed of ball bouncing off a solid surface

Hey all, I am working on a simple game to include some rigid body dynamics, involving placing (moving & rotating) some springs to bounce a falling ball into a target area. My problem is correctly ...
4
votes
1answer
2k views

How do I calculate an inverse bind-pose matrix for COLLADA?

I want to port a rigged mesh from a custom format to COLLADA. The bones I have define a position for the bone (local) and a matrix that transforms the child-bones' positions into the next-higher ...
168
votes
13answers
147k views

What math should all game programmers know? [closed]

Simple enough question: What math should all game programmers have a firm grasp of in order to be successful? I'm not specifically talking about rendering math or anything in the niche areas of game ...
8
votes
4answers
15k views

What is a simple algorithm for calculating evenly distributed points on an ellipse?

I am looking for a simple algorithm to plot evenly distributed points on an ellipse, given the major and minor axes. This is really easy to do with a circle like so: ...
18
votes
5answers
27k views

Good 3D Math Theory Books [closed]

I've been developing a modification for the Source engine for well over a year, but am now facing some troubles with the weapons, gamemovement (player physics) and player feedback from explosives. ...
21
votes
6answers
7k views

What are some methods to represent train tracks?

I looked into this a while back for a small project, but didn't get too far. I'd like to create a small program that lets a user draw a train track and then allows a "train" to follow said track on a ...

1
33 34 35 36
37