Keep same orientation in vtour

  • I have a vtour with a costum map + radar so that every scene has a "heading".

    How can I pass (through hotspot or clicking on the map ) from a scene to another keeping the same orientation ?
    With orientation I mean for example that if the starting scene is pointing north, the target scene should pointing north too.

    KEEPVIEW does NOT count the heading of each scene, so I guess it may be an action that gets the starting scene view, corrects with its heading, and then apply this orientation to the target scene, corrected with heading's target scene.
    I have a mental block on how to write this code *confused*
    btw, "fov" should not be changed.

    Thanks,
    Toni

  • Yes billjones, this is a solution, but for next time: set the center of all equirectangulars pointing the same direction. So, applying KEEPViEW will work. But I have already done the project. I miss just this option.
    The solution should be in storing the the vlookat (pan) + the heading and hlookat (tilt) from the leaving scene and then properly apply this orientation to the next opening scene.
    If there was an "on leave" state like "on start" it could be easy.
    To explain it better, it is just as google street acts passing from pano to pano...

  • I resolved the problem, yes, but partially...

    So I set the "onclick" of the skin_hotspotstyle in vrtourskin.xml with KEEPALL and add the action "orientation":

    Code
    onclick="if(linkedscene, tween(scale,0.25,0.5); tween(oy,-20,0.5); tween(alpha,0,0.5); loadscene(get(linkedscene),null,KEEPALL,BLEND(1)); orientation(); skin_updatescroll(); );"

    The action "orientation" is:

    Code
    <action name="orientation"> add(view.hlookat,get(pointing)); set(view.vlookat,0); set(view.fov,90);</action>

    (I set the vlookat to 0 as the KEEPALL can give some tilt, and same with fov, but these settings can be ignored )

    So this action refers to a variable "pointing" that I need to set in the vtour.xml at each hotspot:

    Code
    <hotspot name="spot6" style="skin_hotspotstyle" ath="111.792" atv="15.943" linkedscene="scene_069" pointing="leaving_pano_heading - destination_pano_heading" />

    This means that the "pointing" variable will have a number that is the result of the "heading" value of the leaving pano minus the "heading" of the destination pano.
    As I said, I have an image map with radar etc., and had found the "heading" for all the panos.

    Now I can calculate manually all the "pointing" and set for each link the value, and this works *g*

    but it would be nice to make it automatically, getting the values from the map, something like:

    Code
    <hotspot name="spot6" style="skin_hotspotstyle" ath="111.792" atv="15.943" linkedscene="scene_069" pointing="sub(pointing,get(layer[map_point_start].heading),get(layer[map_point_destination].heading)" />


    this doesn't work, I'm sure that I'm doing something wrong with "sub" but can't realize what....

    thanks
    Toni

Participate now!

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