You are not logged in.
Pages: 1
I was having a look at the BSL:Frustum and fog page on OniGalore and don't understand the horizontal viewing angle calculation...
In fact I tried to draw it and found : 2*arcsin(4/3*tan(45°/2)) instead of 2*arctan(4/3*tan(45°/2)) ??
Where there's a will for Oni II, there's a way !
Offline
Hum, still no answer, I think I'll explain more in detail... I can be mistaken but I wondered if the calculation on the page linked above is not wrong :
Sorry if it is not as clear as if I wrote it in french, and it would be much easier with a drawing but...
The viewing frustum is a truncated pyramid with a rectangular base, that means that the triangles are isosceles. If we take one of the side surfaces triangles (left or right, it doesn't matter since they are identical), and divide it in half, we have two right triangles. The far end of one of these triangles is 3/2 (I take the example of the 4:3 aspect ratio). The opposite angle is 45°/2, so 22,5°. We can know calculate the height of the triangle, it's : h = 1,5 / tan(22,5°) = 3.62...
That 3.62 value corresponds to the hypotenuse of another right triangle, which has for coordinates the following vertexes : the apex of the pyramid (untruncated), the center of the pyramid base, and the vertex that is at the base of the height of the previous side triangle.
With these informations, we can calculate the horizontal angle of the frustum. It's : 2 times the angle that is between the height of the second right triangle and the 3.62 straight line. To have this angle it's : arcsin (and not arctan) of (2 (the half of the 4 coming form the aspect ratio) / 3.62)...
In the end I find an angle of about 67.05° instead of 57.82°. Am I wrong ?
Where there's a will for Oni II, there's a way !
Offline
Durrr... still not that far in geometry o.O.
"It is not hatred but indifference that will destroy us." -Unknown
"One death is a tragedy. The death of a million is a statistic" -Joseph Stalin
Offline
I have no idea. I'll ask geyser when I next talk to him.
Iritscen:
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours
Offline
Pages: 1