Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 9894

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

1 vote

Help understanding the order of vector subtraction

For vector subtraction, I use the mental image of drawing a bow. If I'm subtracting A - B, I visualize holding up a bow with the arrow point at A, then drawing it back till the tail of the arrow is a …
Nathan Reed's user avatar
  • 33.7k
4 votes

Find point in 3D plane

I'll assume that the A, B, C, D points really do lie on the same plane, i.e. that the two triangles form a single flat surface. The first step is to calculate the plane equation for the plane. If you …
Nathan Reed's user avatar
  • 33.7k
2 votes
Accepted

Camera target point based on angles

If you have desired rotation angles for your camera, then gluLookAt is not really the appropriate function to use. Instead, use glRotate three times, once for each axis of rotation (typically in roll …
Nathan Reed's user avatar
  • 33.7k
1 vote

Adding tolerance to a point in polygon test

A common approach to this sort of thing is to add epsilons to the floating-point comparisons. I'm not completely sure how to do this in the code you linked, since it seems that it's flipping the insi …
Nathan Reed's user avatar
  • 33.7k
1 vote

Find the nearest control points either side of a Catmull Rom spline segment

How you choose the two outside control points depends entirely on what you want the spline to do and what you're trying to do with it. Those points affect how it curves, so you select them based on t …
Nathan Reed's user avatar
  • 33.7k
2 votes
Accepted

Electricity and Magnetism: Relevant?

If you're specifically interested in graphics/rendering, having some E&M and optics wouldn't be a bad thing. You won't use it directly, but just having that background knowledge could be helpful for …
Nathan Reed's user avatar
  • 33.7k
1 vote

Logarithmic spacing of FFT subbands

R12 defines a constraint between a and b, once you've picked n (the number of subbands). For instance, with n = 32 the equation is 32*b + 528*a = 1024. It sounds like a and b are supposed to be inte …
Nathan Reed's user avatar
  • 33.7k
3 votes

Math > Logic for a Logarithmic Score Meter

Sure, you can use a logarithmic function for this, for example: scale = log(score / 160.0 + 1.0) / log(maxScore / 160.0 + 1.0) Here, the value 160 is a constant that controls how steep or shallow t …
Nathan Reed's user avatar
  • 33.7k
4 votes

How do I smooth out of the effects of a too-sensitive control?

A common approach is to raise the values coming from the joystick to a power, for instance squaring them, which improves the sensitivity for small deflections but still allows you to access the whole …
Nathan Reed's user avatar
  • 33.7k
1 vote

How to find the points of intersection of two OBBs

I assume that we're in 2D, and by intersection points you mean the points where an edge of one OBB touches an edge of the other. SAT won't give you those points, but you can easily find them with a s …
Nathan Reed's user avatar
  • 33.7k
26 votes
Accepted

Why does the order matter in multiplication of matrixes?

The fact that matrix multiplication isn't (usually) commutative is a mathematical fact, and doesn't have anything to do with which API or library (XNA, OpenGL, etc.) you're using. At the level of ari …
Nathan Reed's user avatar
  • 33.7k
53 votes
Accepted

Why are radians preferred over degrees in game development?

Radians are used in math because They measure arc-length on the circle, i.e. an arc of angle theta on a circle of radius r is just r * theta (as opposed to pi/180 * r * theta). When trig functions a …
Nathan Reed's user avatar
  • 33.7k
4 votes

Can someone explain the (reasons for the) implications of colum vs row major in multiplicati...

There's two different choices of convention at work here. One is whether you use row vectors or column vectors, and the matrices for these conventions are transposes of each other. The other is whet …
Nathan Reed's user avatar
  • 33.7k
1 vote

How to achieve hologram projection effect with head tracking

It looks to me like you just set the camera position to the user's head position, then run the vertex shader normally. You'd probably need to feed it through a matrix to convert whatever coordinates …
Nathan Reed's user avatar
  • 33.7k
2 votes
Accepted

Position Reconstruction from Depth by inverting Perspective Projection

I believe the difference between the two stems from considering the post-projective (NDC) z range to be [-1, 1] (in your first formula) and [0, 1] (in your second). OpenGL uses the former while D3D u …
Nathan Reed's user avatar
  • 33.7k

15 30 50 per page