How to get a scene hotspot ath value?

  • Hi,

    I'm trying to get a scene hotspot ath value so I could load the scene and it would look at the direction where I was.

    But the following isn't working (bolded):

    scene[get(scenename)].hotspot[get(hotprevscene)].ath

    Code
    <action name="changeradar">
    txtadd(hotprevscene, 'h_', get(previousscene));
    txtadd(scenename, 'scene_', get(%4));
    loadscene(scene_%4, view.fov=30&amp;view.hlookat=scene[get(scenename)].hotspot[get(hotprevscene)].ath, MERGE, ZOOMBLEND(1,2));
    set(previousscene, %4);
    </action>

    Hotspot names and scene names are correct because I use those at the same action (removed from the code above to make it more clear).

    But is that the right way to get information from the scene > hotspot.ath?

  • using KEEPVIEW will keep the view settings and pass them into the next view. it really has nothing to do with hotspots at all. the atv value is read from the view tags howver.

    loadpano(pano.xml,null,MERGE|KEEPVIEW|BLEND(2)); might work.

    Edited once, last by VN2009 (January 21, 2011 at 1:22 AM).

  • Hi,

    thanks for the reply.

    I think my question was unclear. I have the following code:

    And when I click on the scene_scene1 > hotspot [ h_scene2 ] I want go there and LOOK AT the same direction that scene_scene2 > hotspot [ h_scene1 ] is currently pointing. I already managed to look at there by using

    Code
    set(hot_ath, get(hotspot[get(hotprevscene)].ath));
    	set(hot_atv, get(hotspot[get(hotprevscene)].atv));
    	if(hotspot[get(hotprevscene)]!==null,
    		lookto(get(hot_ath),get(hot_atv),90,smooth(150,25,100));			
    	);

    But there's a problem that the view direction is not correct at the beginning.

    Perhaps you want to look at the virtual tour and you see the problem :)  http://tinyurl.com/673rq65

    When you click the first arrow you see, it uses the current view setting and doesn't look at the right direction. Then it starts looking at where we came from, and then just 180° away from the ath where we were. Hope this clarifies.

  • i dont think you need all that code. in scene 2 change the settings to.

    <scene name="scene_scene2">
    <view hlookat ="180"
    vlookat ="0"
    fov ="90"
    fovmin ="30"
    fovmax ="110"
    fisheye ="0.0"
    fisheyefovlink="0.0"
    />

    forget about all that other code. set the hlookat and and vlookat to where you want it to be pointing when it loads. now when loading scene 2 it will be looking right where you want it. this solution is ok for the spots that are in a straight line. when you get further in and have a choice on wether to go left or right you need to add a little code to the hotspot so when it is clicked it will set the next scene hlookat before you load it.

    otherwise delete the hlookat and vlookat from all the scenes and try the keepview tag i still think it might work if you have placed north in the same spot in all of your 2:1 images.

  • Hi,

    thanks for the reply. Those images are not in a straight line so I made it working by copy pasting the ath values to the hotspots like you told. I was looking for a more automated way but after researching the forum & documentation, I found that it's not possible to access the scene sub tags (like hotspots) but just scene[namehere].content/name and onstart.

    Now I have an action that is called everytime when scene is changed and there

    Code
    loadscene(scene_%4, view.hlookat=%7&amp;view.fov=30, MERGE, ZOOMBLEND(1,2));

    And hotspots where I call the action (last one is the ath to be looked at, %7:

    Code
    onclick="action(changeradar, 75, 155, 55, scene_namehere,radar1krs, 0, 18.207327271209707); "

    So this is not possible at the moment: scene[get(scenename)].hotspot[get(hotprevscene)].ath ..

    Klaus: does your todo list contain adding more access to the scene or do you have any ideas how to parse the xml via scene[name].content by NOT using AS3? *smile*

Participate now!

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