Vtour reset view button.

  • Hello every one!

    I'm using the tool make tour (multires). From what I could understand about scripting and programming, the generated tour.xml, let's say, calls the skintour.xml file.


    So the thing is that I added a button in the skintour.xml file to reset the view like this:


    <layer name="skin_btn_rview"
    url="icons/resetview.png"
    align="center"
    x="+122"
    y="0"
    scale="1"
    alpha="0.6"
    ondown="skin_buttonglow(get(name));"
    onup="skin_buttonglow(null);"
    onover=""
    onout=""
    onclick="lookto(0,0,120); view_normal();"
    />


    Now the thing is that this is working like a charm but the problem i'm experiencing is that each scene of my virtual tour could have different vlookat hlookut or fov.

    How can I get those value from the tour.xml?

    Actually in tour.xml each scene does have something like this:

    <view hlookat="-29.315"
    vlookat="-5.957"
    fovtype="MFOV"
    fov="120.000"
    maxpixelzoom="2.0"
    fovmin="70"
    fovmax="140"
    limitview="auto"
    />

    Any help would be really appreciated.

    Best regards


    Maxi

  • Hi,

    there are two possibilities:

    1. either store/save at 'start' of each scene the current/startup 'view' setting in custom variables,
      e.g. by using an action like this:

      Code
      <action name="save_startup_view">
        copy(startup_hlookat, view.hlookat);
        copy(startup_vlookat, view.vlookat);
        copy(startup_fov, view.fov);
      </action>


      and calling it in the 'onnewpano' event (see the vtourskin.xml)

    2. or create a custom xml element inside each <scene> with the startup/home view informations,
      e.g.

      Code
      <scene ...>
        <view ... />
        <startupview hlookat="..." vlookat="..." fov="..." />
        ..
      </scene>


    and then in your reset button 'onclick' event, use these variables,
    e.g. either

    Code
    onclick="lookto(get(startup_hlookat), get(startup_vlookat), get(startup_fov)); ... "


    or

    Code
    onclick="lookto(get(startupview.hlookat), get(startupview.vlookat), get(startupview.fov)); ... "

    best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!