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 sysameca · Feb 27, 2015 at 01:31 PM · camerapositionsizeorthographicperspective

Calculate approximate or same size and position of an 2d sprite(plane) object so it appears the same rendered with orthographic and perspective camera

Is it somehow possible to calculate a 2D plane object(sprite)'s size and position so it appears approximately or entirely the same rendered either with a perspective or an orthographic(or both for that matter) camera? I should also mention that the perspective camera is not rotated and is looking on the same axis as the orthographic.

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 NoseKills · Feb 27, 2015 at 02:10 PM 0
Share

It quickly becomes pretty much impossible, since for example a cube anywhere near the top of a perspective view reveals it's bottom side to the camera, whereas in an orthographic view only the faces facing the view direction will ever show.

I guess you could use Camera.WorldToScreenPoint() to calculate the screen positions of you geometry (meshes/vertices) and then Camera.ScreenToWorldPoint with the new camera to deform your geometry to look very close to what it was in the previous view. There's probably tons of problems with this and it get's easily very complicated.

Depending on what you want, you might be able to compromise. Find 2 camera settings and a distance that make a cube in the center of the view look the same and try to align your camera to that distance of the object of interest whenever you change modes... Or rotate all objects to face the camera and move them into a spherical formation around the perspective camera when moving to that mode. They will still get distorted by the perspective, especially near the screen corners, unless you modify the mesh geometry too, though.

avatar image sysameca · Feb 27, 2015 at 02:16 PM 0
Share

The object is basically a 2d sprite as i wrote in my updated question and the perspective camera is rotated exactly as the orthographic. This is why i though something can be done.

0 Replies

· Add your reply
  • Sort: 

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

20 People are following this question.

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

Related Questions

Orthographic position to Perspective position 0 Answers

Set view frustum shape 2 Answers

Using a perspective camera can an object act as if viewed by orthographic camera? 1 Answer

Draw orthographic visuals (e.g. health bar) in perspective scene? 4 Answers

How can I keep three targets in sight, and keep the camera above a specific height - while it resizes? 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