QTVR Pan OpenCard
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
QTVR Pan OpenCard
Hi Folks,
I have a QTVR which I'd like to open at a different pan angle. I'm using the following script but unfortunately this happens after the QTVR is displayed making it jump. I've tried "on PreOpenCard" but this doesn't work - I guess because the QTVR isn't loaded yet. Any thoughts???
on OpenCard
set the pan of player "myQTVR" to 190
end OpenCard
Thanks
Jim
I have a QTVR which I'd like to open at a different pan angle. I'm using the following script but unfortunately this happens after the QTVR is displayed making it jump. I've tried "on PreOpenCard" but this doesn't work - I guess because the QTVR isn't loaded yet. Any thoughts???
on OpenCard
set the pan of player "myQTVR" to 190
end OpenCard
Thanks
Jim
-
- Posts: 179
- Joined: Sat Apr 08, 2006 11:08 pm
- Location: London, UK
- Contact:
-
- VIP Livecode Opensource Backer
- Posts: 4027
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Hi Jim,
I dont quite understand what you want
If you want to go to a card which has a QTVR already loaded and when opening the card you want it in a certain angle and you dont want the change of angle to be visible then the only way I found was to reload the QTVR on opening the card.
like in:
on OpenCard
lock screen
set the filename of player 1 to field 1
set the pan of player 1 to random(360)
end OpenCard
on preOpenCard
set the filename of player 1 to ""
end preOpenCard
you will not see the change of pan but it takes a bit longer and depending on the size of your QTVR you see a little delay until the QTVR is shown.
for this scenario you could also try
on opencard
lock screen
set the pan of player 1 to random(360)
set the loc of player 1 to the cpPlayerLoc of this stack
set the alwaysbuffer of player 1 to false
end opencard
on preopencard
set the alwaysbuffer of player 1 to true
set the cpPlayerLoc of this stack to the loc of player 1
set the loc of player 1 to "-32000,-32000"
end preopencard
only works if the alwaysbuffer is true, but with alwaysbuffer true you can not manually navigate in the QTVR, therefore the alwaysbuffer in the script. Might be a little faster the reloading the QTVR
I your problem is that you want to load a new QTVR into the player at a given pan then you might try
lock screen
set the filename of player "valid path to file"
set the pan of player 1 to 90
unlock screen
regards
Bernd
I dont quite understand what you want
If you want to go to a card which has a QTVR already loaded and when opening the card you want it in a certain angle and you dont want the change of angle to be visible then the only way I found was to reload the QTVR on opening the card.
like in:
on OpenCard
lock screen
set the filename of player 1 to field 1
set the pan of player 1 to random(360)
end OpenCard
on preOpenCard
set the filename of player 1 to ""
end preOpenCard
you will not see the change of pan but it takes a bit longer and depending on the size of your QTVR you see a little delay until the QTVR is shown.
for this scenario you could also try
on opencard
lock screen
set the pan of player 1 to random(360)
set the loc of player 1 to the cpPlayerLoc of this stack
set the alwaysbuffer of player 1 to false
end opencard
on preopencard
set the alwaysbuffer of player 1 to true
set the cpPlayerLoc of this stack to the loc of player 1
set the loc of player 1 to "-32000,-32000"
end preopencard
only works if the alwaysbuffer is true, but with alwaysbuffer true you can not manually navigate in the QTVR, therefore the alwaysbuffer in the script. Might be a little faster the reloading the QTVR
I your problem is that you want to load a new QTVR into the player at a given pan then you might try
lock screen
set the filename of player "valid path to file"
set the pan of player 1 to 90
unlock screen
regards
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 4027
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Hi Jim,
playing around with this I found the second solution to not work anymore. Why???
So here is what works pretty consistently for me opening a card with a QTVR on this card to a non default pan without going visibly from pan 0 to x
I just wonder, why it works.
Oh well, maybe someone in the know finds a smarter way to do this.
greetings
Bernd
playing around with this I found the second solution to not work anymore. Why???
So here is what works pretty consistently for me opening a card with a QTVR on this card to a non default pan without going visibly from pan 0 to x
Code: Select all
on preopencard
set the alwaysbuffer of player 1 to true
set the cpPlayerLoc of this stack to the loc of player 1
set the loc of player 1 to "-32000,-32000"
end preopencard
on opencard
set the loc of player 1 to the cpPlayerLoc of this stack
set the pan of player 1 to random(360)
set the alwaysbuffer of player 1 to false
end opencard
Oh well, maybe someone in the know finds a smarter way to do this.
greetings
Bernd
Wow that's great it works!
However, what's "cpPlayerLoc"? I can't find it in the documentation dictionary.
Trying your script out I find it works just as well if I do this:
on preopencard
  set the alwaysbuffer of player 1 to true
end preopencard
on opencard
  set the pan of player 1 to random(360)
  set the alwaysbuffer of player 1 to false
end opencard
Many Thanks
However, what's "cpPlayerLoc"? I can't find it in the documentation dictionary.
Trying your script out I find it works just as well if I do this:
on preopencard
  set the alwaysbuffer of player 1 to true
end preopencard
on opencard
  set the pan of player 1 to random(360)
  set the alwaysbuffer of player 1 to false
end opencard
Many Thanks
-
- VIP Livecode Opensource Backer
- Posts: 4027
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Jim,
glad it works for you.
cpPlayerLoc is a custom property that you create in Rev when you set it. It is persistent because it is saved with the stack. It is a way to store a variable and share it from different handlers, even when they are not in the same script. You can look at these properties in the inspector --> custom properties.
I tried your variation of the script and for me it does not work, I still see angle 0 and then angle x.
I thought I was smart in setting the player to an offscreen location then change the pan and set it back to the old location, turns out it is not really that since it only works if I set the location back to the old location and then set the pan. So it may have to do with timing with the graphic engine, Rev is busy with the commands and skips on refresh or something. I really dont get it why it works.
anyhow it is not nice but if it works....
looked at your site and the conceptual art there. Liked it very much.
regards
bernd
glad it works for you.
cpPlayerLoc is a custom property that you create in Rev when you set it. It is persistent because it is saved with the stack. It is a way to store a variable and share it from different handlers, even when they are not in the same script. You can look at these properties in the inspector --> custom properties.
I tried your variation of the script and for me it does not work, I still see angle 0 and then angle x.
I thought I was smart in setting the player to an offscreen location then change the pan and set it back to the old location, turns out it is not really that since it only works if I set the location back to the old location and then set the pan. So it may have to do with timing with the graphic engine, Rev is busy with the commands and skips on refresh or something. I really dont get it why it works.
anyhow it is not nice but if it works....
looked at your site and the conceptual art there. Liked it very much.
regards
bernd