Live data from Hacker News

Books for Game Developers

mrelusive.com

21–30 of 62 posts

Re: Books for Game Developers

#22
post #8

Circa 90s and early 2000s. I like how there's a whole book on quaternions. I've never understood them and I'm convinced every definition I've read was written by someone who also didn't understand them. I might try to find a copy if I ever dabble in 3d again Edit: To clarify, I understand the need for quaternions (to avoid gimbal lock), just not how to use them manually. Euler angles are simple enough, I can change w…

Sounds like they're the gamedev equivalent of a Monad? Which I only vaguely understand as a result of a poster on this forum's "Everyone explains it wrong" style post. Hoping you get a similar response with this.

Quaternions tend to be over-complicated.

Basic concept, 1 dimensional form: you want to represent a direction in a 2D plane. You can use one number, a heading angle, but at some point you reach a full circle and the number has to wrap. This creates annoying special cases. So another approach is to use a 2D vector, a point on a circle. Those are usually normalized so that x^2 + y^2 = 1. No angle is "special". You can average and filter such vectors without problems, for example. This is called a homogeneous representation, because it behaves the same everywhere in its space.

Now upgrade to 2D - latitude and longitude. Near the poles, small positional changes cause huge latitude changes, and computation error increases. This is a serious problem in navigational systems. So it's common to represent latitude and longitude inside of GPS systems as a 3-component vector, a point on a sphere, in what's called "Earth-centered, earth fixed" form. Now you can average or difference measurements without special cases. (Yeah, WGS-84 to compensate for planet not being a perfect sphere, etc.)

Now upgrade to 3D orientation. That's a quaternion. It's a point on a 4-dimensional hypersphere. This can be mapped to a 3D vector pointing in space and a roll around that vector, or to pitch-roll-yaw, etc. As above, a quaternion is a unit vector. It's hard to visualize this, so just shut up and calculate.

Re: Books for Game Developers

#24

Circa 90s and early 2000s. I like how there's a whole book on quaternions. I've never understood them and I'm convinced every definition I've read was written by someone who also didn't understand them. I might try to find a copy if I ever dabble in 3d again Edit: To clarify, I understand the need for quaternions (to avoid gimbal lock), just not how to use them manually. Euler angles are simple enough, I can change w…

My (poor) understanding of quaternions is they are like a vector with a rotation angle around the axis of the vector. This is probably incorrect on many levels. But it was a simple enough explanation that it made sense to my brain why this would work better than simple SRT transform parameters for avoiding gimbal lock. It's been several years since I needed to deal with 3D transformations of any sort, so I'm a bit rusty on all this.

Re: Books for Game Developers

#25
post #17
post #14

Wow. This post gave me emotional whiplash. I opened the collection of links, which is quite good if a bit old. But then I had a subconscious mental itch, and thought, wait... where had I heard the name mrelusive before? That sounds _really_ familiar. And then I remembered - oh, right, mrelusive, JP-what's-his-name. I've read a huge amount of his code. When I was working on Quake4 as a game programmer and technical de…

My biggest takeaway from my time programming in Objective-C was not being afraid to name functions and variables more verbosely. Curious to hear what aspects of Objective-C you feel influenced id?

Well, as I say, I'd been meaning to look into this in more detail because it's something I'd been long curious about. But I don't think I have time right now to dig into it.

Re: Books for Game Developers

#26

Circa 90s and early 2000s. I like how there's a whole book on quaternions. I've never understood them and I'm convinced every definition I've read was written by someone who also didn't understand them. I might try to find a copy if I ever dabble in 3d again Edit: To clarify, I understand the need for quaternions (to avoid gimbal lock), just not how to use them manually. Euler angles are simple enough, I can change w…

> quaternions Instead of representing a rotation by roll, pitch, and yaw... you represent rotations by a 4x4 matrix. As this is a 3-dimension problem being represented in a 4-dimensional matrix, you have some weirdness to the math (IE: you need an additional constraint) but otherwise things get easier. --------- "Why is it easier?" Because roll / pitch / yaw systems have Gimbal Lock. That's... pretty much all you nee…

A quaternion is not a 4x4 transformation matrix. In game development context, it usually refers to a structure consisting of 4 floats and is always assumed to be normalized.

Maybe reading this comment helps: https://news.ycombinator.com/item?id=37527928#37529562

Re: Books for Game Developers

#28
post #22
post #8

Earlier quoted context omitted.

Sounds like they're the gamedev equivalent of a Monad? Which I only vaguely understand as a result of a poster on this forum's "Everyone explains it wrong" style post. Hoping you get a similar response with this.

Quaternions tend to be over-complicated. Basic concept, 1 dimensional form: you want to represent a direction in a 2D plane. You can use one number, a heading angle, but at some point you reach a full circle and the number has to wrap. This creates annoying special cases. So another approach is to use a 2D vector, a point on a circle. Those are usually normalized so that x^2 + y^2 = 1. No angle is "special". You can…

Wow, I had never seen this explanation before. That makes so much sense! Now I finally understand why we always normalize the quaternions and why that is a sensible operation...

Re: Books for Game Developers

#29
post #25
post #17

Earlier quoted context omitted.

My biggest takeaway from my time programming in Objective-C was not being afraid to name functions and variables more verbosely. Curious to hear what aspects of Objective-C you feel influenced id?

Well, as I say, I'd been meaning to look into this in more detail because it's something I'd been long curious about. But I don't think I have time right now to dig into it.

If and when you do, I hope you'll write about it and post it to HN!
Post reply on HN