🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

FPS camera

Started by
12 comments, last by Zakwayda 5 years, 3 months ago
5 hours ago, _WeirdCat_ said:

Still not convinced?

Let's try running your numbers through the algorithm.


x = cp*cy
y = sp
z = cp*sy

p = 73 degrees = 1.27409 radians
y = 45 degrees = 0.78540 radians

cp = cos(1.27409) = 0.29237
sp = sin(1.27409) = 0.95630
cy = cos(0.78540) = 0.70711
sy = sin(0.78540) = 0.70711

x = 0.29237*0.70711 = 0.20674
y = 0.95630
z = 0.29237*0.70711 = 0.20674

0.20674*0.20674 + 0.95630*0.95630 + 0.20674*0.20674 = 0.99999 = ~1

The resulting vector is unit length (allowing for rounding), and no normalization is necessary.

I've looked at your post, but frankly I can't figure out what you're doing. My best guess is that you're starting with a unit-length vector in the plane, then going 'straight up' from there by sin(pitch) to find the coordinate. But that's not how spherical coordinates are computed.

In an earlier post I showed via proof that the resulting vector is unit length and normalization is not required, so unless there was an error in that proof (which I'm perfectly open to), I'm not sure why this is still being debated. If you want to continue to maintain that spherical coordinates (with radius 1) need to be normalized, I think you'll need to contend with the proof provided earlier, or offer a (correct) counterexample or counter-proof of your own.

Sorry to persist with this, but since the forums are a repository of information I think it's important to correct mistakes when they come up (and of course for that reason I always want to be corrected if I make a mistake myself).

If you think any of the above is wrong, let me know. Otherwise, I hope the various proofs and examples I've given are sufficient to settle the matter.

Advertisement

Lol, maybe i forgot to multiple somewhere

15 hours ago, _WeirdCat_ said:

Lol, maybe i forgot to multiple somewhere

Perfectly understandable :)

This topic is closed to new replies.

Advertisement