Rotate new scene in hotspot

  • in a hotspot I use this code to rotate new scene from the point 0 to the point 180.
    lookat(0, 0, 80);
    wait(LOAD);

    oninterrupt(break);

    wait(BLEND);

    lookto(180, 0, 100, smooth(45,45,40));

    it works in krpano 1.0.8.14 but in 1.0.8.15 doesn't work?????????

  • Nothing happens,
    it starts from some where else and in each scene rotates differently.

    I use this code:

    tween(view.hlookat,115);
    wait(LOAD);
    oninterrupt(break);

    wait(BLEND);

    lookto(280, 1, 100, smooth(45,45,40));
    this works but in this code I can not define vertical point and start zoom.

    Einmal editiert, zuletzt von Hadi (5. März 2013 um 17:14)

  • No, it doesn't.
    the complete hotspot code is:

    <hotspot name="spot1" style="hotspot_ani_white"

    ath="32"

    atv="-2"

    zoom="false"

    onhover="showtext(' warehouse -',hotspottextstyle);"

    onclick="set(view.maxpixelzoom,null);

    set(view.fovmin,30);
    looktohotspot(get(name),20);

    loadscene(scene_Warehouse, null, MERGE, BLEND(2));

    lookat(232, 0, 80);

    wait(LOAD);
    oninterrupt(break);

    wait(BLEND);

    lookto(50, 1, 100, smooth(45,45,40));

    "
    />

    in krpono 1.8.15 that skin added this problem happened.

  • Hi,

    the complete code came below:

    <krpano version="1.0.8.15" onstart="startup();" >


    <include url="skin/vtourskin.xml" />

    <memory maxmem="350" />
    <network downloadqueues="auto" decodequeues="auto" caching="true" cachesize="7" retrycount="2" />
    <display fps="60" details="16" tessmode="0" movequality="LOW" stillquality="HIGH" flash10="on" movequality10="HIGH" stillquality10="HIGH" stilltime="0.25" />
    <control usercontrol="all" mousetype="moveto" zoomtocursor="false" zoomoutcursor="true" mouseaccelerate="1.00" mousespeed="10.00" mousefriction="0.95" headswing="0.00" keybaccelerate="0.50" keybspeed="10.00" keybfriction="0.90" keybinvert="false" mousefovchange="1.00" keybfovchange="0.75" fovspeed="3.00" fovfriction="0.90" movetocursor="none" cursorsize="10.0" keycodesleft="37" keycodesright="39" keycodesup="38" keycodesdown="40" keycodesin="16,65,107" keycodesout="17,89,90,109" />
    <plugin name="introimage" url="Files/system.png" align="center" onloaded="set(alpha,0);tween(alpha,1,0.5);" keep="true" zorder="300" onclick="hideintroimage();" />
    <plugin name="proshotlogo" url="Files/mrg.png" align="topleft" onloaded="set(alpha,0);tween(alpha,1,4);" keep="true" zorder="300" x="6" y="3" onclick="openurl(http://www.proshotsystem.ir,_blank)" />
    <plugin name="dblclick" url="Files/dblclick.swf" alturl="Files/dblclick.js" keep="true" ondblclick="switch(fullscreen)" />

    <plugin name="introimage2" title="http://www.proshotsystem.ir" align="center" onloaded="set(alpha,0);tween(alpha,1,0.5);" keep="true" zorder="300" onclick="hideintroimage();" />

    <lensflareset name="DEFAULT" url="Files/flares.jpg" />

    <plugin name="box" url="Files/combobox.swf" preload="true" keep="true" align="topright" x="15" y="15" width="200" blendmode="layer" textalign="right" onclick="trace(combobox clicked);" zorder="200" />

    <events onxmlcomplete="action(qtvrcursor);"
    onpreviewcomplete=""
    onloadcomplete="delayedcall(3, hideintroimage() );"
    onloaderror=""
    onkeydown=""
    onkeyup=""
    onclick=""
    onmousedown=""
    onmouseup=""
    onmousewheel=""
    onidle=""
    onviewchange=""
    onresize=""
    onenterfullscreen="set(plugin[closefs].visible,true);"
    onexitfullscreen="set(plugin[closefs].visible,false);"
    />


    <contextmenu fullscreen="true">
    <item name="n5" enabled="true" visible="true" separator="true" caption="Powered by" onclick="" />
    <item name="n6" enabled="true" visible="true" separator="false" caption="http://www.proshotsystem.ir" onclick="openurl('http://www.proshotsystem.ir',_blank);" />

    </contextmenu>

    <!-- set skin settings: bingmaps? gyro? -->
    <skin_settings bingmaps="false" bingmaps_key="" bingmaps_zoombuttons="false"
    gyro="true"
    thumbsopened="false"
    tooltips_thumbs="false" tooltips_hotspots="false" tooltips_mapspots="false"
    controlbar_offset="20"
    />

    <!-- set optional skin logo url -->
    <layer name="skin_logo" url="" scale="0.25" opened_onclick="openurl('...',_blank);" />


    <action name="startup">


    plugin[box].addIdItem(1, 'warehouse1', loadscene(scene_1, null, MERGE, BLEND(1)); );
    plugin[box].addIdItem(2, 'warehouse2', loadscene(scene_2, null, MERGE, BLEND(1)); );
    plugin[box].addIdItem(3, 'warehouse3', loadscene(scene_3, null, MERGE, BLEND(1)); );



    if(startscene === null, copy(startscene,scene[0].name));
    loadscene(get(startscene), null, MERGE);
    </action>

    <action name="dragcursor">
    set(plugin[dragmode].visible, false);
    set(plugin[movemode].visible, true);
    set(control.mousetype, drag2D);
    set(cursors.url, Files/drag-cursors.png);
    set(cursors.type, drag);
    set(cursors.move, 2|0|30|32);
    set(cursors.drag, 37|0|30|32);
    </action>

    <action name="qtvrcursor">
    set(plugin[dragmode].visible, true);
    set(plugin[movemode].visible, false);
    set(control.mousetype, moveto);
    set(cursors.url, Files/qtvr-cursors.png);
    set(cursors.type, 8way);
    set(cursors.move, 0|0|16|16);
    set(cursors.drag, 16|0|16|16);
    set(cursors.arrow_u, 32|0|16|16);
    set(cursors.arrow_d, 48|0|16|16);
    set(cursors.arrow_l, 64|0|16|16);
    set(cursors.arrow_r, 80|0|16|16);
    set(cursors.arrow_lu, 96|0|16|16);
    set(cursors.arrow_ru, 112|0|16|16);
    set(cursors.arrow_rd, 128|0|16|16);
    set(cursors.arrow_ld, 144|0|16|16);
    </action>
    <action name="hideintroimage">
    if(plugin[introimage].enabled,
    set(plugin[introimage].enabled,false);
    tween(plugin[introimage].alpha, 0.0, 0.5, default, removeplugin(introimage));
    );
    </action>

    <action name="hotspot_animate">
    inc(frame,1,get(frames),0);
    mul(ypos,frame,frameheight);
    txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));
    delayedcall(0.03, hotspot_animate() );
    </action>

    <action name="rectview">
    tween(view.fovmax, 155.0, distance(179, 0.25), easeoutquad);
    tween(view.architectural, 0.0, distance(1.0, 0.25), easeoutquad);
    tween(view.fisheye, 0.0, distance(1.0, 0.25), easeoutquad, set(view.stereographic,false); );
    </action>

    <action name="fisheyeview">
    tween(view.architectural, 0.0, distance(1.0, 0.25), easeoutquad);
    tween(view.fisheye, 0.0 ,distance(1.0, 0.20), easeoutquad,
    set(view.stereographic,false);
    set(view.fovmax,179);
    tween(view.fisheye, 0.35, distance(1.0, 1.25));
    );
    </action>

    <action name="architectural">
    tween(view.fovmax, 155.0, distance(179, 0.25), easeoutquad);
    tween(view.architectural, 1.0, distance(1.0, 0.25), easeoutquad);
    tween(view.fisheye, 0.0, distance(1.0, 0.25), easeoutquad, set(view.stereographic,false); );
    </action>



    <!-- disable the default progress bar -->
    <progress showload="none" showwait="none" />

    <!-- text styles -->

    <textstyle name="hotspottextstyle"
    font="Arial" fontsize="18" bold="true" italic="true" textcolor="0xFFF7EF" background="false" border="false"
    alpha="1" blendmode="layer" effect="glow(0x000000,0.5,4,3);dropshadow(4,45,0x000000,4,0.66);"
    origin="cursor" edge="bottom" textalign="center" xoffset="0" yoffset="-3" noclip="true" showtime="0.1" fadetime="0.25" fadeintime="0.1"
    />
    <textstyle name="infostyle" origin="center" edge="center" yoffset="-100" textalign="center" background="false" border="false" fontsize="40" font="Arial" textcolor="0xFFFFFF" bold="false" effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);" showtime="1.5" fadeintime="1.0" fadetime="1.0" />
    <textstyle name="hotspotstyle" xoffset="0" yoffset="-25" textalign="center" background="false" border="false" fontsize="18" textcolor="0xffffff" italic="false" bold="false" effect="glow(0x000000,0.7,4,2);dropshadow(2,45,0x000000,3,1);" />
    <textstyle name="thumbstyle" xoffset="0" yoffset="-25" textalign="center" background="false" border="false" fontsize="18" textcolor="0xffffff" italic="false" bold="false" effect="glow(0x000000,0.7,4,2);dropshadow(2,45,0x000000,3,1);" showtime="3" fadetime="0.5" fadeintime="0.5" />
    <textstyle name="buttonstyle" font="Arial" fontsize="18" border="false" background="false" textcolor="0xFFFFFF" effect="glow(0x000000,0.7,4,2);dropshadow(2,45,0x000000,3,1);" />
    <textstyle name="FOVTEXT" origin="top" edge="top" yoffset="35" textalign="center" background="false" border="false" fontsize="30" textcolor="0xFFFFFF" bold="false" effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);" showtime="2.0" fadetime="1.0" fadeintime="2.0" />

    <!-- hotspot styles -->
    <style name="hotspot" url="Files/hotspot.swf" alturl="Files/hotspot.png" scale="0.75" altscale="0.5" altonloaded="if(isphone, mul(scale,2));" />
    <style name="spot_light" url="Files/spot_light.swf" alturl="Files/spot_light_big.gif" altscale="0.25" altonloaded="if(isphone, mul(scale,2));" />
    <style name="spot_dark" url="Files/spot_dark.swf" alturl="Files/spot_dark_big.gif" altscale="0.25" altonloaded="if(isphone, mul(scale,2));" />

    <action name="hotspot_animate">
    inc(frame,1,get(frames),0);
    mul(ypos,frame,frameheight);
    txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));
    delayedcall(0.03, hotspot_animate() );
    </action>


    <!-- disable the default progress bar -->

    <progress showload="none" showwait="none" />


    <!-- hotspot styles (for Flash and HTML5) -->

    <style name="hotspot_ani_black"

    url="Files/hotspot_ani_black_64x64x20.png"

    crop="0|0|64|64"

    framewidth="64" frameheight="64" frame="0" lastframe="19"

    onloaded="hotspot_animate();"

    altonloaded="if(isphone, mul(scale,2)); onloaded();"
    />


    <style name="hotspot_ani_white"

    url="Files/hotspot_ani_white_64x64x20.png"

    crop="0|0|64|64"

    framewidth="64" frameheight="64" frame="0" lastframe="19"

    onloaded="hotspot_animate();"

    altonloaded="if(isphone, mul(scale,2)); onloaded();"
    />


    <style name="button1"

    url="Files/button1.png"

    />


    <action name="hotspot_animate">

    inc(frame,1,get(lastframe),0);

    mul(ypos,frame,frameheight);

    txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));

    delayedcall(0.03, if(loaded, hotspot_animate() ) );

    </action>


    <autorotate enabled="true" waittime="1.0" accel="1" speed="13" horizon="0" tofov="100" />


    <events onviewchange="if(hotspot[nadirlogo].rotatewithview, set(hotspot[nadirlogo].rotate,get(view.hlookat)) );" />



    <scene name="scene_1" title="" onstart="action(startscene);" thumburl="Files/1.tiles/thumb.jpg" lat="" lng="" heading="">


    <action name="startscene">
    showtext('warehouse1 -', infostyle);
    plugin[box].selectIdItem(1);
    </action>


    <view hlookat="88" vlookat="0" fovtype="MFOV" fov="120" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto" />

    <preview url="Files/1.tiles/preview.jpg" />

    <image type="CUBE" multires="true" tilesize="512" progressive="false">
    <level tiledimagewidth="1083" tiledimageheight="1083">
    <cube url="Files/1.tiles/l2_%s_%v_%h.jpg" />
    </level>
    <level tiledimagewidth="512" tiledimageheight="512">
    <cube url="Files/1.tiles/l1_%s_%v_%h.jpg" />
    </level>
    <mobile>
    <cube url="Files/1.tiles/mobile_%s.jpg" />
    </mobile>
    </image>

    <hotspot name="spot1" style="hotspot_ani_white"

    ath="88"

    atv="7"

    zoom="false"

    onhover="showtext('warehouse2 -',hotspottextstyle);"

    onclick="set(view.maxpixelzoom,null);

    set(view.fovmin,30);
    looktohotspot(get(name),20);

    loadscene(scene_2, null, MERGE, BLEND(2));

    lookat(100, -4, 80);

    wait(LOAD);
    oninterrupt(break);

    wait(BLEND);

    lookto(260, 1, 100, smooth(45,45,40));

    "
    />


    <hotspot name="nadirlogo"
    url="Files/Shot.png"
    ath="0"
    atv="90"
    distorted="true"
    scale="1.5"
    rotate="0.0"
    rotatewithview="false"
    onclick="switch(rotatewithview); invalidatescreen();"
    />


    </scene>


    <scene name="scene_2" title="" onstart="action(startscene);" thumburl="Files/3.tiles/thumb.jpg" lat="" lng="" heading="">


    <action name="startscene">
    showtext('warehouse2 -', infostyle);
    plugin[box].selectIdItem(2);
    </action>


    <view hlookat="0" vlookat="0" fovtype="MFOV" fov="120" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto" />

    <preview url="Files/3.tiles/preview.jpg" />

    <image type="CUBE" multires="true" tilesize="512" progressive="false">
    <level tiledimagewidth="1083" tiledimageheight="1083">
    <cube url="Files/3.tiles/l2_%s_%v_%h.jpg" />
    </level>
    <level tiledimagewidth="512" tiledimageheight="512">
    <cube url="Files/3.tiles/l1_%s_%v_%h.jpg" />
    </level>
    <mobile>
    <cube url="Files/3.tiles/mobile_%s.jpg" />
    </mobile>
    </image>

    <hotspot name="spot1" style="hotspot_ani_white"

    ath="87"

    atv="-4"

    zoom="false"

    onhover="showtext('warehouse1 -',hotspottextstyle);"

    onclick="set(view.maxpixelzoom,null);

    set(view.fovmin,30);
    looktohotspot(get(name),20);

    loadscene(scene_1, null, MERGE, BLEND(2));

    lookat(88, 7, 80);

    wait(LOAD);
    oninterrupt(break);

    wait(BLEND);

    lookto(260, 1, 100, smooth(45,45,40));

    "
    />

    <hotspot name="spot2" style="hotspot_ani_white"

    ath="-90"

    atv="5"

    zoom="false"

    onhover="showtext('warehouse3 -',hotspottextstyle);"

    onclick="set(view.maxpixelzoom,null);

    set(view.fovmin,30);
    looktohotspot(get(name),20);

    loadscene(scene_3, null, MERGE, BLEND(2));

    lookat(-5, 0, 80);

    wait(LOAD);
    oninterrupt(break);

    wait(BLEND);

    lookto(170, 1, 100, smooth(45,45,40));

    "
    />


    <hotspot name="nadirlogo"
    url="Files/Shot.png"
    ath="0"
    atv="90"
    distorted="true"
    scale="1.5"
    rotate="0.0"
    rotatewithview="false"
    onclick="switch(rotatewithview); invalidatescreen();"
    />


    </scene>


    <scene name="scene_3" title="" onstart="action(startscene);" thumburl="Files/4.tiles/thumb.jpg" lat="" lng="" heading="">


    <action name="startscene">
    showtext('warehouse3 -', infostyle);
    plugin[box].selectIdItem(3);
    </action>


    <view hlookat="0" vlookat="0" fovtype="MFOV" fov="120" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto" />

    <preview url="Files/4.tiles/preview.jpg" />

    <image type="CUBE" multires="true" tilesize="512" progressive="false">
    <level tiledimagewidth="1083" tiledimageheight="1083">
    <cube url="Files/4.tiles/l2_%s_%v_%h.jpg" />
    </level>
    <level tiledimagewidth="512" tiledimageheight="512">
    <cube url="Files/4.tiles/l1_%s_%v_%h.jpg" />
    </level>
    <mobile>
    <cube url="Files/4.tiles/mobile_%s.jpg" />
    </mobile>
    </image>


    <hotspot name="spot1" style="hotspot_ani_white"

    ath="-5"

    atv="0"

    zoom="false"

    onhover="showtext('warehouse2 -',hotspottextstyle);"

    onclick="set(view.maxpixelzoom,null);

    set(view.fovmin,30);
    looktohotspot(get(name),20);

    loadscene(scene_2, null, MERGE, BLEND(2));

    lookat(-90, 5, 80);

    wait(LOAD);
    oninterrupt(break);

    wait(BLEND);

    lookto(80, 1, 100, smooth(45,45,40));

    "
    />


    <hotspot name="nadirlogo"
    url="Files/Shot.png"
    ath="0"
    atv="90"
    distorted="true"
    scale="1.5"
    rotate="0.0"
    rotatewithview="false"
    onclick="switch(rotatewithview); invalidatescreen();"
    />


    </scene>


    </krpano>

  • Hi,

    okay, it seems your using the 1.0.8.15 vtour default skin...
    But the problem here, that skin uses several events to automatically update the skin when loading a new scene and that events can interfere with the wait(), oninterrupt() and lookto() calls...

    I can't provide solution now, but I will think about it...

    Best regards,
    Klaus

  • hi,
    as I told if I use this code: tween(view.hlookat,115);
    instead of: lookat(115, -5, 80);
    it works but there is small problem that, in the code lookat, vertical point is -5 and start zoom is 80,
    which in tween it has not vertical point and start zoom.


    Best Regards,
    Hadi.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!