Krpano minor opening

Source: Internet
Author: User
Tags xml example

Technical support and requirements:

Please contact QQ 178941086 to indicate"Blog"


Requirements:

The scenario starts with an minor. After the minor view lasts for a certain period of time, it is automatically restored to the normal view. The following is an official example:

Http://www.krpano.com/examples/117/examples/xml-usage/littleplanet-intro/littleplanet-intro.html


Solution:

<Krpano> <! -- Pano image --> <preview url = ".. /.. /panos/p3/preview.jpg "/> <image> <cube url = ".. /.. /panos/p3/pano_%s.jpg "/> </image> <! -- The initial setting of the opening of an minor must meet the conditions in parentheses (stereographic = true + fisheye = 1.0 + fov> 120 + vlookat> 70) --> <view stereographic = "true" fisheye = "1.0" fov = "155" fovtype = "VFOV" fovmax = "150" hlookat = "-60" vlookat = "77" /> <! -- The fish eye and the minor field of view require more cpu resources for rendering. In order to reduce cpu requirements and achieve better quality and frame rate, switch to Flash9 In The fisheye model --> <display flash10 = "off" details = "24"/> <! -- Switch to the normal field of view after the minor lasts 2 seconds --> <events onloadcomplete = "delayedcall (2.0, normalview ()); "/> <action name =" normalview "> tween (view. hlookat,-40, 2.5, easeInOutQuad); tween (view. vlookat,-35, 2.5, easeInOutQuad); tween (view. fov, 85, 2.5, easeInOutQuad); tween (view. fisheye, 0.0, 2.5, easeInOutQuad); wait (2.7); set (display. flash10, on); showtext ('[B] [I] krpano [br] little planet intro example [/I] [/B]', infostyle) </action> <! -- Showtext () textstyle --> <textstyle name = "infostyle" origin = "center" edge = "center" yoffset = "-39" textalign = "center" background = "false" border = "false "fontsize =" 40 "textcolor =" 0 xFFFFFF "bold =" false "effect =" glow (0 xFFFFFF, 0.7, 0.6); glow (0 x, 1,); dropshadow (, 0 x ); "showtime =" 3.0 "fadeintime =" 1.0 "fadetime =" 1.0 "/> </krpano>


Details:

<view stereographic="true"  fisheye="1.0"  fov="155"  fovtype="VFOV"  fovmax="150"  hlookat="-60"  vlookat="77"  />


The relationship between stereographic and fisheye is similar to the relationship between visible and alpha that controls visibility and transparency. First, the relationship must be true because fisheye has two types: normal, the other is stereographic. Only the true value can beMinor PlanetIt means that when fisheye is 0, it is completely distorted, and when fisheye is 1, it is the largest twist. The fov angle must be greater than 120 degrees and the vlookat value must be greater than 70, so as to have the minor eye effect from the ceiling. Of course this is not absolute, like

The example of http://www.krpano.com/examples/littleplanets/ here is the setting below

  • View. stereographic = true
  • View. fisheye = 1.0
  • View. vlookat = 60 to 90
  • View. fov = 130 to 150
In particular, in the last example, vlookat is only-3, which achieves an effect similar to that of the Minor Planet. This is also because the camera is placed horizontally.


<action name="normalview">tween(view.hlookat, -40, 2.5, easeInOutQuad);tween(view.vlookat, -35, 2.5, easeInOutQuad);tween(view.fov,     85,  2.5, easeInOutQuad);tween(view.fisheye, 0.0, 2.5, easeInOutQuad);wait(2.7);set(display.flash10, on);showtext('[b][i]krpano[br]little planet intro example[/i][/b]', infostyle)</action>

In 2.5 seconds, the conversion from the fish eye to the normal field of view is mainly to convert the above four parameters and enable Flash 10 at the same time.


The following is an xml example that uses the right-click menu to implement different fields of view.

<krpano version="1.17"><!-- krpano 1.17 default buttons skin --><!-- disable progress bar --><progress showload="none" showwait="none" /><!-- default mouse control mode (moveto or drag2d) --><control mousetype="moveto" /><!-- default autorotate settings (disabled by default) --><autorotate enabled="false" waittime="1.0" accel="2.0" speed="8.0" horizon="0.0" tofov="90.0" /><!-- control buttons --><style name="defaultskin_button" url="%SWFPATH%/skin/buttons-2.png" scale="0.5" align="lefttop" /><layer name="defaultskin_buttons" type="container" width="360" height="40" align="bottom=" y="10" scalechildren="true" scale="1.0" keep="true"><layer name="btn_in"       x="0"   style="defaultskin_button" crop="320|0|80|80" onovercrop="320|80|80|80" ondown="set(fov_moveforce,-1);"     onup="set(fov_moveforce,0);"     /><layer name="btn_out"      x="40"  style="defaultskin_button" crop="400|0|80|80" onovercrop="400|80|80|80" ondown="set(fov_moveforce,+1);"     onup="set(fov_moveforce,0);"     /><layer name="btn_left"     x="80"  style="defaultskin_button" crop=  "0|0|80|80" onovercrop=  "0|80|80|80" ondown="set(hlookat_moveforce,-1);" onup="set(hlookat_moveforce,0);" /><layer name="btn_right"    x="120" style="defaultskin_button" crop= "80|0|80|80" onovercrop= "80|80|80|80" ondown="set(hlookat_moveforce,+1);" onup="set(hlookat_moveforce,0);" /><layer name="btn_up"       x="160" style="defaultskin_button" crop="160|0|80|80" onovercrop="160|80|80|80" ondown="set(vlookat_moveforce,-1);" onup="set(vlookat_moveforce,0);" /><layer name="btn_down"     x="200" style="defaultskin_button" crop="240|0|80|80" onovercrop="240|80|80|80" ondown="set(vlookat_moveforce,+1);" onup="set(vlookat_moveforce,0);" /><layer name="btn_ctrlmode" x="240" style="defaultskin_button" crop="800|0|80|80" onovercrop="800|80|80|80" onclick="switch(control.mousetype,moveto,drag2d); switch(control.touchtype,moveto,drag2d); update_ctrl_mode();" /><layer name="btn_autorot"  x="280" style="defaultskin_button" crop="480|0|80|80" onovercrop="480|80|80|80" onclick="switch(autorotate.enabled);" /><layer name="btn_fs"       x="320" style="defaultskin_button" crop="560|0|80|80" onovercrop="560|80|80|80" onclick="switch(fullscreen);" visible="true" devices="fullscreensupport" /></layer><!-- no fullscreen support => no fullscreen button => smaller container width --><layer name="defaultskin_buttons" width="320" devices="!fullscreensupport" /><events name="defaultskin_buttons" keep="true"        onxmlcomplete="update_ctrl_mode(); update_fs_button();"        onenterfullscreen="update_fs_button();"        onexitfullscreen ="update_fs_button();"        /><action name="update_ctrl_mode">if(control.mousetype == drag2d,<!-- set mouse cursor graphic -->set(cursors.url, %SWFPATH%/skin/drag-cursors-2.png);set(cursors.type, drag);set(cursors.move,  0|0|32|32);set(cursors.drag, 32|0|32|32);<!-- set button graphic -->set(layer[btn_ctrlmode].crop,       720|0|80|80);set(layer[btn_ctrlmode].onovercrop, 720|80|80|80);  ,<!-- set mouse cursor graphic -->set(cursors.url, %SWFPATH%/skin/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);<!-- set button graphic -->set(layer[btn_ctrlmode].crop,       800|0|80|80);set(layer[btn_ctrlmode].onovercrop, 800|80|80|80);  );</action><action name="update_fs_button">if(fullscreen,set(layer[btn_fs].crop,       640|0|80|80);set(layer[btn_fs].onovercrop, 640|80|80|80);  ,set(layer[btn_fs].crop,       560|0|80|80);set(layer[btn_fs].onovercrop, 560|80|80|80);  );</action><!-- context menu --><contextmenu><item name="krp" caption="KRPANO"     /><item name="fsc" caption="FULLSCREEN" /><item name="scm" caption="Change Controlmode" onclick="switch(control.mousetype,moveto,drag2d); switch(control.touchtype,moveto,drag2d); update_ctrl_mode();" separator="true" /><item name="nrm" caption="Normal View"        onclick="skin_view_normal();"        showif="view.vlookatrange == 180" separator="true"      /><item name="fis" caption="Fisheye View"       onclick="skin_view_fisheye();"       showif="view.vlookatrange == 180" devices="flash|webgl" /><item name="ste" caption="Stereographic View" onclick="skin_view_stereographic();" showif="view.vlookatrange == 180" devices="flash|webgl" /><item name="arc" caption="Architectural View" onclick="skin_view_architectural();" showif="view.vlookatrange == 180"                       /><item name="pan" caption="Pannini View"       onclick="skin_view_pannini();"       showif="view.vlookatrange == 180" devices="flash|webgl" /><item name="lpv" caption="Little Planet View" onclick="skin_view_littleplanet();"  showif="view.vlookatrange == 180" devices="flash|webgl" /></contextmenu><!-- actions for view changing --><action name="skin_view_normal">tween(view.fovmax,       150.0, distance(179, 1.00), easeoutquad);tween(view.architectural,  0.0, distance(1.0, 0.45), easeoutquad);tween(view.fisheye,        0.0, distance(1.0, 0.45), easeoutquad, set(view.stereographic,false); if(view.pannini, set(view.pannini,false); delayedcall(0,updateobject(true,true)); ); );set(centerview,false);if(view.architectural LT 0.2,if(view.vlookat LT -60, set(centerview,true));if(view.vlookat GT +60, set(centerview,true));if(centerview, tween(view.vlookat, 0.0, distance(90, 0.45), easeoutquad));  );if(view.fov GE 150, tween(view.fov, 100.0, distance(50, 0.45), easeoutquad));</action><action name="skin_view_fisheye">tween(view.architectural, 0.0, distance(1.0, 0.30), easeoutquad);tween(view.fisheye,       0.0 ,distance(1.0, 0.30), easeoutquad, set(view.stereographic,false); if(view.pannini, set(view.pannini,false); delayedcall(0,updateobject(true,true)); ); set(view.fovmax,179); tween(view.fisheye, 0.35, distance(1.0,1.25)); );</action><action name="skin_view_architectural">tween(view.fovmax,       150.0, distance(179, 1.00), easeoutquad);tween(view.architectural,  1.0, distance(1.0, 0.45), easeoutquad);tween(view.fisheye,        0.0, distance(1.0, 0.45), easeoutquad, set(view.stereographic,false); if(view.pannini, set(view.pannini,false); delayedcall(0,updateobject(true,true)); ); );</action><action name="skin_view_stereographic">tween(view.architectural, 0.0, 0.25);set(backtonormalfirst,false);if(view.pannini       == true,  set(backtonormalfirst,true) );if(view.stereographic == false, set(backtonormalfirst,true) );if(backtonormalfirst, tween(view.fisheye, 0.0 ,distance(1.0, 0.25), easeoutquad, WAIT); );if(view.pannini, set(view.pannini,false); delayedcall(0,updateobject(true,true)); );set(view.stereographic, true);set(view.fovmax, 150);tween(view.fisheye, 1.0, distance(1.0, 0.75), easeoutquad);</action><action name="skin_view_pannini">tween(view.architectural, 0.0, 0.25);set(backtonormalfirst,false);if(view.pannini       == false, set(backtonormalfirst,true) );if(view.stereographic == false, set(backtonormalfirst,true) );if(backtonormalfirst, tween(view.fisheye, 0.0 ,distance(1.0, 0.25), easeoutquad, WAIT); );set(view.pannini, true);set(view.stereographic, true);set(view.fovmax, 150);tween(view.fisheye, 1.0, distance(1.0, 0.75), easeoutquad);</action><action name="skin_view_littleplanet">tween(view.architectural, 0.0, 0.25);tween(view.vlookat,  90, distance(179, 1.50), easeoutquad);set(backtonormalfirst,false);if(view.pannini       == true,  set(backtonormalfirst,true) );if(view.stereographic == false, set(backtonormalfirst,true) );if(backtonormalfirst, tween(view.fisheye, 0.0 ,distance(1.0, 0.25), easeoutquad, WAIT); );if(view.pannini, set(view.pannini,false); delayedcall(0,updateobject(true,true)); );set(view.stereographic, true);set(view.fovmax, 150);tween(view.fisheye, 1.0, distance(1.0, 0.75), easeoutquad);tween(view.fov,     150, distance(179, 0.75), easeoutquad);</action></krpano>


You can use these actions to change the field of view or add them to your menus or buttons.


Tip:

Copy the following link http://www.krpano.com/docu/projections/#top below is also a translation of the link content, it is recommended to read.

View the effects of different viewing fields in the roaming environment.


Therefore, there are many English languages. The following projection types are no longer translated into Chinese.

  • Normal Projection
  • Standard 3D projection, also called rectilinear projection or gnomonic projection
  • Vision close to human eye when the field of view is less than 100 degrees
  • If the field of view is relatively wide, stretching and twisting at the edge will be very serious.
  • View. fisheye is set to 0

  • Fisheye Projection
  • The wide angle of the normal view can be avoided under the view of the fish eye
  • Edge distortion can be a lot better, but all "straight lines" won't pass through pano right now
  • Krpano can control the projection degree between the fish eye and the normal field of view
  • If fisheye is 0, it is not a fish eye projection. If fisheye is 1, it is a full fish eye projection. The default value is 0.35.
  • Fisheyefovlink is the second parameter for controlling the eye. This parameter controls the relationship between the fov and fisheye. If 0 is used, the fisheye will not be changed based on the field of view. If you use a large value, in this way, fisheye will be applied in a large perspective. The default value is 0.5.

  • Stereographic Fisheye Projection
  • More extreme fish eye projection
  • It can be used to create an minor.
  • Set stereographic to true and fisheye to 1, which can be used to implement an minor, that is, the most extreme situation.
  • Only normal or stereographic fish eye types
  • You can also use fisheye and fisheyefovlink to control the projection strength.

  • Architectural Projection
  • This kind of roaming is almost straight up and down
  • The vertical line is always vertical when roaming up and down directly
  • Of course, it is impossible to directly go up and down for browsing.
  • The projection effect is also set between 0 and 1. When it is set to 1, the projection effect is realized.
  • You can also use architecturalonlymiddle to make the projection only appear in the center of the panorama.

Comparison of Different view types:






Comparison of portraits


Fisheye of 0.45

Complete fish eye





Comparison of Buildings






Technical support and requirements:

Please contact QQ 178941086 to indicate"Blog"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.