How do you compute where you have to aim to hit a moving target with a finite-speed projectile? This is a common question on gamedev.net's forums. This article presents a procedure to solve this problem and some variations thereof.
Tagged With:
deflection
math
geometry
target leading
leading the target
Once you bite the bullet and decide to use a physics engine for your game pieces, you are going to have to come to terms with making them move naturally. Getting a handle on handling forces to make things "turn" can be a psychotic episode in the making. Instead, do what the engineers do in the real world and use a PID control loop.
This article tries to simplify the math behind calculating inertia tensor of a cylinder as much as possible without skipping on any important details. Implementation in C/C++ is presented at the end.
In this article we will look at a modified spring equation that is very easy to tune, displays maximum possible stiffnes and damping, and is guaranteed to keep any spring system stable under all conditions. The equation is tailored for 1st order symplectic Euler integration and impulse based simulation.
Tagged With:
spring
damping
mass-spring-damper
harmonic oscillator
reduced mass
game physics
You never shoot directly at a moving target. You shoot at where the target is going to be when your shot gets there. Millions of years of biology make it easy for predators. Turns out it's pretty easy for computers as well...if you know the math.
Smooth collision detection is a requirement for any game, whether you're running around in an FPS or landing a spacecraft on the Moon. This article talks through the first of two methods for implementing simple collision detection for objects commonly encountered in games. It will use DirectX syntax, but it is easy enough to apply to other APIs.
Tagged With:
collision detection
trees
bounding
cylinder
A series of videos on the mathematics behind shaders, covering topics including normal mapping, lambertian surfaces, specularity, sprite lamp normal generation and fog
Tagged With:
shaders
normal maps
lambertian surfaces
specularity
fog
sprite lamp
normals
Any graphical game needs a way to place objects on the screen, move them, rotate them, and even grow or shrink them. Transformation matrices offer a very elegant solution to this problem.
Math for Game Developers is exactly what it sounds like - a weekly instructional YouTube series wherein I show you how to use math to make your games. Every Thursday we'll learn how to implement one game design, starting from the underlying mathematical concept and ending with its C++ implementation. The videos will teach you everything you need to know, all you need is a basic understanding of...
This advanced article on intersection tests is primarily about curve intersection, but it also contains useful information for primitive intersection tests, such as point-line, line-line, and line-circle. These can be extended to 3D primitives as well.
Anybody who has dealt with rotating sprites probably has dealt with angles. Representing a sprite's rotation as an angle makes certain operations, such as rotating towards another angle, much more complicated than it should be. There is a better way. Use unit vectors.
There's a lot about the basics of Bezier curves around, but how about actually using them? This will show a few new things about Bezier curves, a few techniques in coding up curves, and serve as a primer for Bezier surfaces and B-splines.