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 mediavr · Jan 19, 2012 at 02:31 AM · navigationmouse lookpanoramacamera script

Interactive 360 panoramas camera script

Hi I am trying to get interactive panorama camera navigation working. If you look say, at this Quicktime panorama (-- that I did, of an amazing mirror installation by Japanese artist Yayoi Kusama) http://www.mediavr.com/infinityroom2.htm you can see that it is different from standard mouse look. The idea is that you can click anywhere in the panorama (skybox) and depending how far and the direction you drag before you let the mouse up the panorama pans left or right or up or down at a speed and direction proportional to how far and in what direction you have dragged (this is standard interactive 360 panorama navigation). When I was scripting such things in Lingo for Director this is the script I used (you can see it constrains vertical tilting too)

"on mouseDown me

set startV = the mouseV set startH = the mouseH

repeat while the mouseDown mypan = member("newBox").cameraRotation[2] mytilt = member("newBox").cameraRotation[1] myroll = member("newBox").cameraRotation[3]

set tDX = -(the mouseH - startH) / 1800.0 set tDY = -(the mouseV - startV) / 1800.0

mypan =mypan + tDX

mytilt = mytilt + tDY if mytilt >90 then set startV= the MouseV set tDY = -(the mouseV - startV) / 300.0 if tDY > 0 then set tDY = 0 end if end if

if mytilt <-90 then set startV= the MouseV set tDY = -(the mouseV - startV) / 300.0 if tDY < 0 then set tDY = 0 end if end if

member("newBox").cameraRotation = vector(mytilt, mypan, 0)

end "

thanks!

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by DaveA · Jan 19, 2012 at 03:12 AM

Take a look at the MouseLook script, it's basically that. You'd add mouse-down detection and speed based on mouse position (or relative to where mouse went down)

Comment
Add comment · Show 1 · 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 vuong_vin · Dec 23, 2014 at 04:20 PM 0
Share

Hello,

I'm make follow @DaveA. $$anonymous$$y scene just have a $$anonymous$$ainCamera and a ObjectGame. attached $$anonymous$$ouseLook script into $$anonymous$$ainCamera, then build/run for iPad. Anytime i touch in iPad's screen to rotate panorama, the scene alway start/reset with same position/angle. What wrong for me?

(For sample. Panorama scene set TOP when open it. I rotated to saw the Gound(down). Now i want rotate continue to see the front - Camera RESET from TOP to FRONT of scene when i touch to screen, it should be moved from DOWN to front) Hope you understand my english.

Thanks.

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

6 People are following this question.

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

Related Questions

Panorama reset position/angle. 0 Answers

Is there a way to see your coordinates in the scene view? 1 Answer

button as gameobject child 2 Answers

Knockback using Navmesh 1 Answer

Object slows down when moving to a NavPoint, speed is not constant 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