You are not logged in.

rouillip

Beginner

  • "rouillip" started this thread

Posts: 39

Location: Paris

Occupation: developer

  • Send private message

1

Monday, December 2nd 2013, 8:36am

How to identify wich scene is playing

In a Krpano tour i have an xml file with 4 scenes, and i use the plugin compass . I would synchronize the compass.heading, the hlookat of each scene, and the actual direction .
how could i define the condition "scene[x] is playing "to identify the actual playing scene


<plugin name="compass" devices="html5"
url="plugins/compass.js"
enabled="true"
keep="true"

onavailability="action(rotor)"
onchange="action(rotor)"
/>

<action name="rotor">
if(scene[0] is playing,
copy(view.hlookat, heading); sub(hlookat,90);)

if(scene[1] is playing,
copy(view.hlookat, heading); add(hlookat,72);)

if(scene[2] is playing,
copy(view.hlookat, heading); sub(hlookat,136);)

if(scene[3] is playing,
copy(view.hlookat, heading); sub(hlookat,42);)

if(scene[4] is playing",
copy(view.hlookat, heading); add(hlookat,127);)
</action>

Any help would be appreciated

Patrick

Alexey Tkachenko

Professional

Posts: 770

Location: Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

2

Monday, December 2nd 2013, 8:39am

Hi! Use "xml.scene" variable to check conditions:

http://krpano.com/docu/actions/#xml.scene
Regards,

Alexey