Jump to content
  • Advertisement
Sign in to follow this  
moeen k

make 2 perspective camera not to overlap

This topic is 520 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 Im working on a shooting trainer project that 2 camera should be placed beside each other to show bigger range of environment. but in perspective camera always cameras show a part of each other but in real want to make those  cameras make feel like a single eye sight and not to show part of each other views.

 

im working on unity.

 

thank you for helping.

Share this post


Link to post
Share on other sites
Advertisement

Perspective mode cameras have a view volume, too. The volume is a frustum of a pyramid (as opposed to a cuboid for orthographic mode cameras). It is "just" a matter of aligning the volumes.

 

In Unity a perspective mode camera has the parameter "field of view", which is the view's angle in degrees along the local y axis. Using the aspect ratio of the view, the corresponding angle for the local x axis can be calculated. Now, since the horizontal view angle is between the left side of the view and the right side, and exactly on the half between them is the line of sight, the angle between the lines of sight of two aligned cameras is just the horizontal view angle.

 

So create a new local co-ordinate system, put both cameras inside it (positioned at the local origin), rotate the "left" one by half the horizontal view angle to the left around the local y axis, rotate the "right" one the same but to the right, and let the camera controls alter the entire co-ordinate system.

 

Besides the simple approach above, more sophisticated things can be done by adapting the both projection matrices.

Edited by haegarr

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!