Author Topic: Notes on the journal of the main developer of Infinity  (Read 3926 times)

Offline Rosencrantz

  • Gray Haired
  • Lieutenant Commander
  • ****
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Notes on the journal of the main developer of Infinity
« on: August 30, 2006, 03:37:17 am »
I've been looking through this guys journal some just to get a feel for where he started and how he got there, and if any of it is useful to us.

First of all, can someone with more graphics background explain field of view?
Specifically I'm referring to his Aug 30, 2004 post.
Quote
I finally fixed the impostor bug. The formula i used was wrong, i was not calculating the frustum field of view angle correctly. It was a bit tricky to understand why, but revising my trigonometry helped a bit. For those interesting, the code looks like this: for a viewer position located at ViewPos, the impostored object being represented as its bounding sphere Center, Radius,

float d = distance(ViewPos, Center)
float fov = asin(Radius / d)
float l = d * tan(fov)
matrix4x4 viewMatrix = buildLookAtMatrix(ViewPos, Center)
viewMatrix = buildTranslateMatrix(-ViewPos) * viewMatrix.transpose()
matrix4x4 projMatrix = buildProjectionMatrix(fov, 1, znear, zfar)
matrix4x4 worldMatrix = buildIdentityMatrix()

Looking at what kind of triangle that math produces makes absolutely no sense physically. I'd expect something more like.

fov = atan(Radius/d)
l = Radius / sin(fov)

Is there something missing? (Probably the definition of field of view).


Offline Morgul

  • GNE Founder
  • Godlike Fuzzy Dice
  • Grand Admiral
  • **********
  • Posts: 2086
  • Karma: +21/-4
  • Godlike Fuzzy Dice
    • View Profile
    • G33X Nexus Entertainment
Re: Notes on the journal of the main developer of Infinity
« Reply #1 on: August 30, 2006, 09:33:05 am »
Unfortunately, I have not background in this stuff at all, just a minor physics background. Howeverf, I have to agree with you, I would have expected your forumlas not his. Odd.
"Just because my math may tell lies doesn't mean that I don't understand the quantum mechanics of it all." --Caenus

The popular videogame "Doom" is based loosely around the time Satan borrowed two bucks from Vin Diesel and forgot to pay him back.

"In the beginning there was nothing. And it exploded." --Terry Pratchett