Skip to content

Mazda CX-7 by arampan.

Switching between 2 synced VRs

Hello,

This is a response to a QTVR-List thread, since it is very LSP specific, and really this is the place to talk about those things, IMHO.

Quoted from Aaron McCaffery:
I've been playing with LSP over the past little while and was wondering if someone can point me in the right direction to be able to switch between two different panoramas on the fly, syncing zoom, pan and tilt between the two so I can change between two different colour schemes in a room.
I assume that I will need to embed both VRs into the same file, but where do I go next?

Here is what I have done in the past:

- Create an LSP project with both QTVRs as separate "nodes" in the same, single VR track. (Double the overhead, but preloading is needed)
- Add a Sprite Track to hold some important scripts and perhaps act as a "click trigger" to switch between the VRs.

(And the tough nut...)

- Synchronize the Pan, Tilt, and FOV of both QTVR nodes so that when you switch, they will be pointing in the same direction when you switch between them!

So, what I have done is to set up some simple MovieVars for Pan, Tilt, and FOV and set an idle event to constantly check for those values. Then I access those variables when entering *either* node, so that the QTVRs are "snapped" to the same focal point at switch time. Pretty simple, and here is how I did it:

1) In your Sprite track, add a simple placeholder image (something small - I used the default toucan) and then create a Sprite using this image.
2) To avoid seeing the image in your VRs, put it in a lower layer and under Sprite Properties uncheck the Visibility (and make un-clickable if you don't want to use it switch between nodes)
3) Go to the Scripts section for that sprite, and under Idle (event), add a MovieVars definition like this:
MovieVars pan tilt fov
pan=Tracknamed("VRtrack").PanAngle
tilt=Tracknamed("VRtrack").TiltAngle
fov=Tracknamed("VRtrack").FieldOfView

With those in place, you can now add a script that checks these variables and uses them for "aligning" your QTVR nodes *upon entering* the node. So...
4) In each of your QTVR nodes in the VR track (my example called "VRtrack"), double click to get the VR Editor window for that node.
5) In the Scripts section of the VR Editor for that node, and under Node Entered call those variables to set the pan, tilt, and fov for that QTVR:
MovieVars pan tilt fov
Tracknamed("VRtrack").SetPanAngleTo(pan)
Tracknamed("VRtrack").SetTiltAngleTo(tilt)
Tracknamed("VRtrack").SetFieldOfViewTo(fov)

6) Add this script again to the second node, in the same place, so that they will be synced again when switched back.

Using the above scriptbits and a simple multinode QTVR track, you can be assured that whenever you switch between nodes, they will point in the same direction (naturally, your QTVRs are constructed pixel-for-pixel identically... right?) and even have the same zoom. Your initial settings for pan/tilt/fov will only be used the first time the initial node is opened, and can be set from the VR Editor dialog as well.

That takes care of synchronization when switching between them, but now how do you actually go from one node to the other? The easiest way is to define a hotspot in each QTVR that, like normal multinode VRs, would "transport" you to the next node. You can define the shape and make the connections entirely in LSP (and the hotspot can cover the entire VR, if you want). Or, with the sync method I have outlined above, you can use an external button (even from the same Sprite track as above) to say "switch colors" without affecting the VR. Keep in mind that sprite overlays *on top* of a QTVR severely degrade its performance, and wherever that sprite overlay is clickable, the QTVR will not be "navigable." Having a button off the side is typically best, and can even be done as a wired control from another movie on the same web page (but that gets beyond this discussion).

Okay, one final caveat: this worked for me in 2005 with LSP 4.1 - no guarantees that it will be the same in LSP 4.6.6 and that it will work equally well in QT 7.1.x in both OS X and Windows (heck, Vista is a crapshoot in general).

Good luck, and post your followup questions (and links to your eventual VRs) here! This is where LiveStagePro for QTVR has come to live and be (somewhat) supported.

-Mark

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Switching between 2 synced VRs

Hi ,
I`ve been testing your tutorial,about switching between different qtvr movies.
I took 2 qtvr objects (each 800/600 resolution) instead of 2 panorama movies and I didn`t achieve satisfactory results.
The first thing that caused difficulties were hotspots.

In a example scene that you prepared, the created hotspots are "attached" to the panoramas: if you rotate panorama, the hotspots move with it.There are to be seen in all rendered frames.

In my test scene you can see a hotspot in a first frame only. In all other frames they are not to be found.

The second issue that I`m interested in is the scene resolution.

In your example each movie has low resolution an a huge compression.
The qtvrs that I was testing are about 130 MG and have 800/600 px resolution.

Does Live Stage Pro work with such big movies?
Could the resolution of my qtvr objects be the reason why your tutorial didn`t work?

I look forward to your response.
Best Regards

Sylwia Kubus

Re: Switching between 2 synced VRs

That would be ideal, but my general concern is the difficulty of managing effective VR preloading for two different files for the same VR. My thinking at this stage is to combine both 'schemes' (read: VRs) into each .mov file (in this case there are only 2 per node) so that each node only displays once both schemes are loaded.

Am I on the right track?

_____________________
Submited by : Embarazo