Archived

This topic is now archived and is closed to further replies.

Camera moving on sphere/pincushion effect

This topic is 4983 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I have a terrain which is spherical, according to earth shape. The center of the earth is (0, 0, 0). I have my camera class, which has vDir, vUp, and vRight perpendicular each other. If I rotate my view up or down, I rotate my camera vDir and vUp using vRight as the rotation axis. If I rotate my view left or right, I rotate my camera vRight and vDir using my current eye coordinate (i.e. vector from (0, 0, 0) to eye point) as the rotation axis. The vUp vector the calculated using cross product of vRight and vDir. I use eye vector so that my view will align properly with the earth spherical shape. My view matrix is made using Direct3D LookAtLH function, with eye point, lookAt point and up vector as the parameters. Using this method, I got a kind of ''pincushion effect'' while rotating my view. The screen looks like being a little convex. Is my camera class method correct for this kind of terrain? Thanks very much.

Share this post


Link to post
Share on other sites
I think it may also be affected by the distance of the near clipping plane. Don''t remember for sure.

Hmm.. Just thought of something: it may be possible to use a custom projection matrix to add some sort of distortion to compensate for the effect without changing the field of view or moving near clip plane... Unforetunately, I''m not fluent with projection matrix math. Perhaps someone else can comment on this?

Michael K.,
Co-designer and Graphics Programmer of "The Keepers"



We come in peace... surrender or die!

Share this post


Link to post
Share on other sites