deathshadow
04-04-2004, 01:58 PM
I'm kind of new to GL and these boards, but not to 3d since I did some stuff 7-8 years ago by hand... and I have an odd question resulting from an interesting situation.
What I'm doing is trying to render all 360 degrees of vision into a single strip at the top of the screen. I was thinking easy, just render it as three 120 degree wide projections.
Here's the problem, if I turn the viewpoint as objects reach the edge of a projection they get bigger despite their distance not changing (kind of a fish-eye effect). In an old-style hand written 3d I would simply apply an inverse-sin to the z to fix this... How would I set openGL up to do this? I want the object's points to have the same Z adjustment to X and Y regardless of the objects distance.
Ideally I'd like it to:
Screen_Y= Y / actual distance
Screen_X= angle to(x,z)
Am I going to have to switch to Orthographic 2d Projection and do the math by hand, or is openGL capable of doing this for me? I actually have the math for doing this already written, but doing it by hand with a 3d landscape is abysmally slow; getting worse with detailed models in said landscape. (let's face it, calling Arctan(x/z) is not the fastest way of doing things)
What I'm doing is trying to render all 360 degrees of vision into a single strip at the top of the screen. I was thinking easy, just render it as three 120 degree wide projections.
Here's the problem, if I turn the viewpoint as objects reach the edge of a projection they get bigger despite their distance not changing (kind of a fish-eye effect). In an old-style hand written 3d I would simply apply an inverse-sin to the z to fix this... How would I set openGL up to do this? I want the object's points to have the same Z adjustment to X and Y regardless of the objects distance.
Ideally I'd like it to:
Screen_Y= Y / actual distance
Screen_X= angle to(x,z)
Am I going to have to switch to Orthographic 2d Projection and do the math by hand, or is openGL capable of doing this for me? I actually have the math for doing this already written, but doing it by hand with a 3d landscape is abysmally slow; getting worse with detailed models in said landscape. (let's face it, calling Arctan(x/z) is not the fastest way of doing things)