- Home /
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!
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)
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
Follow this Question
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