x


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").cameraRotation1 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!

more ▼

asked Jan 19 '12 at 02:31 AM

mediavr gravatar image

mediavr
1 1 1 1

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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)

more ▼

answered Jan 19 '12 at 03:12 AM

DaveA gravatar image

DaveA
26.8k 153 171 257

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x106
x25
x7
x5

asked: Jan 19 '12 at 02:31 AM

Seen: 1044 times

Last Updated: Jan 19 '12 at 03:12 AM