Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by 1337GameDev · Apr 11, 2012 at 06:05 AM · camerazoomviewdistortion

Zooming a camera without distorting edges with POV changes

Right now i have a camera that i zoom in and out, but objects around the edges (when zoomed in as they look normal when zoomed out) seemed to get stretched and distorted. Is there a way to avoid this, while still using POV? If not, is there an efficient way of zooming without stretching objects on the edges of the camera visible fostrum?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlucardJay · Apr 11, 2012 at 08:58 AM 0
Share

$$anonymous$$aybe set your camera to Orthographic , rather than Perspective. (depends on what you are doing [2D, 3D])

avatar image 1337GameDev · Apr 12, 2012 at 04:51 AM 0
Share

I'll test with different cameras if i have too, thanks for the suggestion.

1 Reply

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by CHPedersen · Apr 11, 2012 at 08:27 AM

Moving the camera is an unreliable solution, since it accounts poorly for geometry that might be in the way; the camera migh get moved beyond hilltops or the walls of houses and make you see behind things when zoomed which are in front of the camera while unzoomed.

Changing the FOV is the only reliable way to implement zoom, and thankfully, also happens to be what a real camera does when it zooms. :) A physical camera changes the focal length of its lens, which in turn changes the angle of view, which corresponds to the FOV of a computer graphics camera.

Also, increasing the field of view does not zoom in, it is the other way around. :) "Zooming in" occurs when the FOV is changed to something smaller than the camera's default "zoomed out" FOV. This makes intuitive sense, because the size of an object will take up more of the viewport's area, if the angle of view is smaller. Conversely, if the angle of view is greater, then the same camera will fit more of the world into its viewport, and thus, the individual object in the world must become smaller.

The distortion you describe sounds like what happens when the FOV approaches 180 - the perspective curves and becomes twisted? I'm not 100% certain what you mean by stretching and distorting when zoomed in, but perhaps this could be caused because you're zooming very close to 1 when you zoom in? Try to play around with the FOV with a camera in the editor and study the camera's frustum as you change the FOV. Notice that the view frustum becomes very long and thin when the FOV is low? This happens because the far plane is at the same distance from the camera, so to reach it with such a low FOV, the frustum must become a very thin, long pyramid. This means that vectors along one side of the frustum to the camera become almost parallel to vectors from the middle of the frustum to the camera, i.e., the camera basically approximates orthogonality at extremely low FOVs. Depending on how geometry is positioned relative to the camera, this might stretch the objects in the sides of the screen, because the camera's projection loses its perspective correctness.

Keep with the FOV solution for zooming, but perform the zooming within a range of values that are still comfortably far from 1 and 180. Something like zoomed out = 90 and zoomed in = 40, or maybe 60/30.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Kleptomaniac · Apr 11, 2012 at 09:36 AM 0
Share

O$$anonymous$$, thanks Christian ... I think I'll probably delete my answer ... it was pretty bad :D

avatar image 1337GameDev · Apr 12, 2012 at 04:53 AM 0
Share

Thanks for the info! The distortion happens to an object on the edge when i'm zoomed in closer to the screen. Ill check my values, but what if those values arent enough to zoom in where i want? Then what should i do?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Scene view camera zooming rather than dollying 1 Answer

First Person Camera Distortion Problem 0 Answers

Avoid/Minimize Sprites extrapolation in 2D while camera changes size 0 Answers

What is the typical setup for switching between third and first person, in terms of model culling? 0 Answers

Zoom in on object and make other objects disappear on zoom?,Zoom in on object and make other objects disappear 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges