Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Art-Napas · Mar 19, 2017 at 08:36 AM · camera rotatepositioningcamera-lookcamera viewport

Calculate camera position when angle is change but viewport bottom need to be fixed?

Hello unity answer community, I'm very pleased to meet you all. I'm still novice for unity script programing, if you have sometimes to help me answer this question would be greatly appreciated :)

I'm now making a mobile turn base game, which camera is a top-view style but player is being able to change the view angle to see a little bit further more ahead in perspective.

For example alt text

As from the example above, when the camera angle is change from view A to view C (X-Rotation) the Viewport (Bottom Left) and (Bottom Right) must be still sit on the bottom of the (Ground Plane)

and more importantly the viewport to world point coordinate (Bottom Left) and (Bottom Right) must be still point to the exact (Bottom Left) and (Bottom Right) of the Ground Plane

for example bottom left (0,0) and bottom right (0,100) if my screen width is equal to 100 in world space

Consider if

  • the camera Z vector is point toward my ground image

  • my camera projection is perspective

  • my ground image have to be a fixed size

  • I cannot just change the pivot and rotating my image because it has some game mechanic involving to it

The problem is if I just change the camera angle (X Rotation) the view angle is change but it also makes my bottom left and bottom right of ground image dose not fit perfectly in the screen anymore. I have to change the camera position (Y) and camera position (Z) to make my image fit again.

Question is How can I calculate camera position (Y and Z position) when the player change the view angle to make the game view looks like it transition from view A to view C in the example picture above

Please forgive me if my question seem a little bit confuse and it dose not explain correctly. I don't really know the keyword to search for the answer of this question, how to make the name of topic and how to explain it. I have been struggling in this problem for many days.

note: the images I use in the picture is been googled for explanation purpose only and I will not use it in my real game.

Thank your for your detailed answers.

example.png (282.2 kB)
Comment
Add comment
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

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

my camera show an extremely weird aspect [android] 0 Answers

How can I mimic a Camera from a game to my project? 1 Answer

Camera behaviour when looking directly up or down 0 Answers

How to make my Camera Controller look at target 0 Answers

Camera movement according to rotation and actual position RTS 1 Answer


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