Hacker News new | past | comments | ask | show | jobs | submit login
3D Math Primer for Graphics and Game Development (gamemath.com)
216 points by noch on May 19, 2021 | hide | past | favorite | 12 comments



I've just been browsing for a bit, but this seems like a really great book! Most "maths for games" books feel like the authors are just regurgitating their university exams. This is very focused on the "why" rather than just the "how" - it feels like this book is actually trying to teach, not simply be a reference.

It's rare to find resources written by good teachers. I'm excited to dig in more!


I recommend it. I have the first version of the book, the one he says to recycle..

I read it as a high school student, because I wanted to get into game development back then. Thanks to this book, I started to really understand 3D mathematics. It helped me write my first 3D engine in OpenGL, with help of some other resources including some advanced rendering techniques.

Normal math books explain this very differently, making the connection between 3D and math super unapproachable.


Nice.

Looking at this decades after it was written, I'd suggest that a modern book needs more on how light behaves and what physically based rendering is trying to do. Because today you write shaders.

On the other hand, game physics is such a specialized area that it may be worth omitting entirely. Nobody writes their own physics engine any more. Send people to "Physics for Game Developers" for that.


Using a physics engine still requires understanding how to calculate the forces you want to apply which requires a fair understanding of basic mechanics at the very least.

There are also definitely people writing their own physics. I did so myself not that long ago for a project. For our constrained problem it only took a week to get going. Then you have the case where you want to write a controller that has physics like behaviour that isn’t readily achievable with middleware easily. A good understanding of the principles behind physics engines helps a lot here.

For example the ship motion here is a rigidbody sim I wrote from scratch: https://www.youtube.com/watch?v=bs1p22oI_V4

Whereas all the locomotion of individual players including them jetpacking around is hand written behaviour with a simpler Euler integrator for linear motion only. You can try that directly: https://dotbigbang.com/game/3772901474b3423fa21e20bdf0a84cf4...

Then the good old damped spring is an amazingly versatile tool to have available in all sorts of weird places.


Writing a general-purpose rigid-body physics engine like PhysX or Havok is probably overkill for most games (unless you’re a big enough company like Blizzard who can recruit developers specialized in physics). The Newtonian physics itself isn’t really that hard (unless you’re doing robotics-style articulated bodies), but detecting collisions and resolving contact and friction forces is where most of the difficulty lies in. But a lot of simpler, specialized stuff is perfectly doable even for indie devs. For example, if you’re writing a platformer, chances are that you don’t need to go full-realism and only need “pseudo”-physics with lots of assuptions. Maybe all of your objects only need box or sphere colliders so you can greatly simplify your collision detection. Or maybe you just need physics for some effects (such as ropes or cloth), which you can code easily with minimal research. Remember, when you’re writing games, you don’t need to go full realism, you can probably “fake” a lot of things!


> Nobody writes their own physics engine any more

Citation needed


The scope of the physics engine matters. Every indie dev who’s written a well-made 2D platformer has written their own physics code (you can’t just get the snappiness of platformers with plugging in a general-purpose physics engine.) You can say it’s just fake “pseudo”-physics, but it’s still legitimate to me.

On the other hand, if you’re going on a journey to write a general-purpose rigid body physics engine like PhysX for your games (without using any middleware), it’s a lot harder but still doable. For example, Overwatch has its own specialized physics engine (although probably possible because Erin Catto is there...) Roblox also has its own physics engine, and their GDC talks about it are pretty interesting.


Awesome book! I have fond memories of it since I read it on the beach in Hawaii during my honeymoon.


This is a great book I have read in past. It primarily focuses on underlying math for interactive graphics but you will notice it will also touch photo-realism later. Indeed, it describes how raytracing works at chapter 10 "The Lighting Equation: Putting It All Together" and covers wide span of graphics knowledge.


I loved those Wordware Game Developer's Library books back in the day. I'm not sure exactly why, but the DirectX 9 era spawned a lot of books on game development. Maybe a sweet spot between usability, pace of change, and art demands.


Indeed a great book. Dr. Parbery was my comp. graphics prof. And then when he started the first game programming course, I was in one of the first batches.


It looks like a great book, but when I started doing the exercises I realized that the appendices where the answers are aren't there, so it's pretty hard to verify what I'm computing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: