News Examples Documentation Download Buy Forum Contact

Documentation

Plugins

XML Extensions

Tools


Third Party Software
for krpano

KxEngine/xKinect Application/Plugin
by J.Ph Degletagne - xkinect@jphd360.net

Description

A complete, multilingual, customizable solution based on
- Windows Seven Application (.exe)
- Krpano plugin (.swf, .xml)
- Kx_? customizing files (.xml)
to interface (c)Microsoft Kinect Device Sensor with virtual tour.
(generated by KrPano (c)KrPano or PanotourPro (c)Kolor)

Current Version:
- Application/Plugin: 0.9j (March, 27 2012).
- Current documentation: 0.2g (March, 27 2012).

News:
In version 0.9j
--
Tour time management
-- Licence implementation

In version 0.9h
--
Prefix hotspots names

- Original documentation

Hardware and Software Requirements

- Windows Seven Worksation.
- Microsoft Kinect Window Sensor.
- Microsoft Kinect for Windows, SDK 1.0.
- Krpano 1.8.0.14.

No Download

Commercial solution, licence number by Kinect device.

Visitor's status managed:

- Nobody on the stage:
- Visitor coming on stage:
    Stop autorotation, Sound on, Welcome message.
- Visitor at center of stage:
- Visitor immobile:
    Return to entry point of the current panorama.
- Visitor leaving the stage:
    Restart the tour.
- Example of status icons, inactive / active:
icons_status_f

Visitor's actions managed:

- Body:
    Front, Back, Left, Right.
    After left hand activation: Up, Down.
- One hand (left or right):
    when down: Left, Right.
    when up: Show and Go.
- Two hands up:
    when away: Zoom.
    when closer: Unzoom.
- Example of action icons, inactive / active:
icons_actions

Optional tour feature

- Tour time management, Visitor's tour stop on elapsed time:

YouTube result example

Technical Interactive Architecture

- Three layers:
1) Windows Seven Application: visitor's gestures detection.
2) HTML krapno tour page: visitor's tour interface.
3) Krpano XML code and resources: visitor's status/actions control.

- Click on green documentated parts.

kxengine_architecture kx_library.xml HTML_Page.xml kxengine.exe kx_config.xml kx_params.xml kxengine.xml kx_styles.xml kx_texts.xml

kxengine.exe, Kinect Windows Seven Application

Main binary windows application:
- to configure Kinect device sensor,
- to configure stage,
- to detect visitor's datas and gestures,
- and to manage HTML KrPano tour page in an internal web browser control.
- .EXE compliant only with Microsoft Windows Seven Operating System (all versions).

Required:
        Windows Kinect Device Sensor
Load, by order: Set of customizable parameters HTML KrPano Tour Page

kxengine Parameters file

A set of customizable parameters to adjust:
- Kinect Device Sensor,
- Stage aera,
- Gestures detection.
- Not described here.

	...
	<add key="kCorrection" 		value="0,70"/>
	<add key="kSmoothing" 		value="0,30"/>
<add key="kPrediction" value="0,40"/>
<add key="kJitterRadius" value="1,0"/>
<add key="kMaxDeviationRadius" value="0,50"/> ... <add key="centerX" value="0,00"/>
<add key="centerY" value="0,00"/> ... <add key="spineMaxX" value="0,75"/>
<add key="spineMaxY" value="0,75"/> ...

HTML KrPano Tour Page

The HTML tour page loaded by KxEngine.exe.

URL command line parameters:
        u.txt=""

Tour optional command line parameters:
        t.log=""
        t.cfg=""
        t.par=""
        t.sty=""
        t.txt=""
        t.lib=""
        t.atr=""
        t.pan=""
        t.hsp=""
        t.icn=""
        t.snd=""

Panorama optional command line parameters:
        p.ath=""
        p.atv=""
        p.fov=""

Call:
        kxengine.xml

HTML command line parameters

URL fixed parameters:

  • u.txt
    • Used to pass browser/user language and automatically select corresponding texts messages file: {kx_config.path}/texts/kx_texts_{u.txt}
      • HTML code example:
...
<div id="container">
<div id="kxengineDIV" style="width:100%; height:100%;">
<noscript>
<table width="100%" height="100%">
<tr valign="middle">
<td><center>ERROR:<br/><br/>Javascript not activated<br/><br/></center></td>
</tr>
</table>
</noscript>
</div>
</div> <script src="swfobject/swfkrpano.js"></script> <script>
// <![CDATA[ var viewer = createPanoViewer({swf:"kxengine.swf", id:"kxengineObject", target:"kxengineDIV"});
// set the default xml files
viewer.addVariable("xml", "kxengine.xml");
// pass all parameters from the html file to the viewer
viewer.passQueryParameters();
// pass the browser language to the viewer (IE/SAFARI/CHROME/FF)
var curlanguage = String(window.navigator.userLanguage || window.navigator.language);
curlanguage = curlanguage.substring(0,2);
viewer.addVariable("u.txt", curlanguage);
// embed and start the viewer
viewer.embed();
// ]]>
</script>
...

Tour optional parameters to force normal settings defined in kxconfig.xml:

  • t.log
    • Set to true, to force trace execution
  • t.cfg
    • To force loading of kxconfig_{t.cfg}.
      • When not passed the standart kxconfig.xml is loaded.
  • t.par
    • To force loading of {kx_config.path}/params/kx_params_{t.par}
  • t.sty
    • To force loading of {kx_config.path}/styles/kx_styles_{t.sty}
  • t.txt
    • To force loading of {kx_config.path}/texts/kx_texts_{t.txt}
      • When HTML command line {t.txt} parameter is passed, the HTML command line {u.txt} parameter is ignored.
  • t.lib
    • To force loading of {kx_config.path}/libraries/kx_library_{t.lib}
  • t.atr
  • t.pan
    • To force iD of the first XML panorama file to load and to display.
  • t.hsp
  • t.icn
    • To force additional plugin visitor's status icons management.
  • t.snd
      • To force additional plugin sound management.
  • p.ath
    • To force view.hlookat initial position.
  • p.atv
    • To force view.vlookat initial position.
  • p.fov
    • To force view.fov initial value.
  • Example of command line:
.../LeCrochetSup.html?t.log=1&t.txt=fr&t.pan=3
    • Display result:
      • Log is activated, language is set to French and first xml pano loaded is virtualtour3.xml.

    register_stage

kxengine.xml, kinect actions application file

Krpano XML code to manage visitor's actions.
- Called by HTML krpano tour page
- Implement plugins: textfield.swf, soundinterface.swf and xkinect.swf.
- Protected.

Load, by order:
        kx_config.xml
        kx_params_?.xml
        kx_styles_?.xml 
        kx_texts_?.xml
        kx_library_?.xml
...before to load the first panorama.xml.

Exported functions
...About menu
        Right Click Context Menu
...Basic licence
        kx_load_pano();
        kx_autoclick();
        kx_hotclick();
        kx_resetclick();
        kx_display_html();
        kx_hide_html();
        kx_display_hotspots();
        kx_hide_hotspots();
...Extended licence
        kx_init_timer();
        kx_display_timer();
        kx_get_position();

kxengine.xml

...
<events onloadcomplete="onloadcompleteaction();"/>

<action name="onloadcompleteaction">
	kx_load_pano();
</action>
...
...
<hotspot name="spot1" hview="..." vview="..." fovview="..." 
hcenter="..." vcenter="..." handcursor="false" onclick="kx_hotclick(1);" onhover="kx_autoclick();" onout="kx_resetclick();" ...
...
<hotspot name="spot1" hview="..." vview="..." fovview="..." 
hcenter="..." vcenter="..." handcursor="false" onclick="kx_hotclick(1);" onhover="kx_autoclick();" onout="kx_resetclick();" ...
...
<hotspot name="spot1" hview="..." vview="..." fovview="..." 
hcenter="..." vcenter="..." handcursor="false" onclick="kx_hotclick(1);" onhover="kx_autoclick();" onout="kx_resetclick();" ...

kx_config_?.xml, configuration file

Global virtual tour parameters.
- Default name fixed to kx_config.xml,
-
or set using HTML command line {t.cfg} parameter, to load kx_config_{t.cfg}.xml.

Header, {About} informations:

<kx_about_config
        _libel="Production"
        _date="2012/03"
        _version="0.9j"
/>

Exported Attributes:

<kx_config        
        _log="false" 
        path="virtualtourdata"
        params="default" 
        styles="default"
        texts="en,fr"
        library="default"
        prefixpano="virtualtour"
        firstpano="0"
        prefixhspot="spot"
/>

kx_config attributes

  • _log
    • To trace execution.
    • When HTML command line {t.log} parameter is used, this {_log} flag is ignored.
  • path
    • Path to all resources called by KxEngine.xml.
  • params
    • Name of xKinect plugin parameters set stored in {kx_config.path}/params/ subdirectory.
    • The location and name must be {kx_config.path}/params/kx_params_{kx_config.params}.xml
      • Example: kx_params_default.xml
  • styles
    • Name of styles file stored in {kx_config.path}/styles/ subdirectory.
    • The location and name must be {kx_config.path}/styles/kx_styles_{kx_config.styles}.xml
      • Example: kx_styles_default.xml
  • texts
    • List of defined text languages files stored in {kx_config.path}/texts/ subdirectory.
      • The browser must pass the navigator language thru HTML command line {u.txt} parameter (or you need to fix it thru HTML command line {t.txt} parameter).
    • The location and name must be {kx_config.path}/texts/kx_texts_{u.txt}.xml .
      • English and french already defined
    • When language or texts file is not defined or identified the first one is choosen.
      • Example: kx_texts_en.xml
  • library
    • Name of customer's code extension library, file stored in {kx_config.path}/libraries/ subdirectory.
    • The location and name must be {kx_config.path}/libraries/kx_library_{kx_config.library}.xml
      • Example: kx_library_default.xml
  • prefixpano
  • firstpano
    • ID of the first panorama XML file to load and to display.
    • Example, with PanoTourPro: {prefixpano}0.xml
  • prefixhspot
    • Prefix hotspot's name managed in XML Tour files.
    • Example, with PanoTourPro: spot{number}
      • For each panorama the first hotspot should be numbered "1".

kx_params_?.xml, parameters file

Technical kxEngine/xKinect plugin set of parameters regarding each possible visitor's body or hand status or actions:
- register, entry, exit, center, click, left, right, front, back, up, down, zoom, unzoom and goto.
- Set in kx_config.xml or using HTML command line {t.par} parameter.
- Some standart (krpano's) or similar attributes are managed but not described.

Header, {About} informations:

<kx_about_params
        _libel="Windows OS, Production"
        _date="2012/03"
        _version="0.9j"
/>

Exported Attributes:

<kx_params 
        start_autorotate="true"
        ...
        stop_auto="true"
        stop_delay="240"
        ...       
        click_auto="true"
        click_delay="1"
        click_outcenter="false"
        click_onfovmin="true"
        click_hidehspots="true"
        click_motion="smooth(400,20,100)"

        center_delay="20"
        center_motion="linear(60)"

        left_delay="2.0"
        left_angle="2.0"
        left_max="4.0"
        left_accel="1.025"
        
        right_*
        ...

        goto_delay="3.0"
        goto_motion="smooth(720,720,720)"
/>

kx_params attributes

  • start_*
    • Panorama autorotation control awaiting visitor's detection.
  • stop_auto
    • To activate time tour limitation at visitor's "entry"
      • EXTENDED LICENCE REQUIRED.
  • stop_delay
    • Time tour duration limitation, seconds.
      • When the time is elapsed, the tour is restarted.
      • EXTENDED LICENCE REQUIRED.
  • click_auto
    • Authorize automatic "onclick" event when visitor stays over an hotspot.
  • click_delay
    • Delay (s) before to raise automatic click.
  • click_outcenter
    • Authorize automatic click when visitor is outside of center stage.
    • When set to "false" the visitor has to be on center stage to change of panorama.
  • click_onfovmin
    • Authorize automatic click on hotspot maximum zoom.
    • REQUIRED data
      <view... limitview="range" hlookatmin="..." hlookatmax="..." vlookatmin="..." vlookatmax="..." fovmin="..." fovmax="..." fov="..." hlookat="..." vlookat="...".../>
      in each xml panorama file!!!

  • click_hidehspots
  • click_motion
    • Motion used during automatic click.
  • center_delay
    • Delay (s) before to raise automatic return panorama's entry point when visitor is immobile.
    • REQUIRED data
      <panoview ... h="..." v="..." fov="...">
      in each xml panorama file!!!

  • center_motion
    • Motion used during automatic return entry point.
  • left_delay
    • Delay (s) before to turn left.
  • left_angle
    • Initial angle value to turn left.
  • left_max
    • Maximum angle value to turn left.
  • left_accel
    • Acceleration applied during left movement.
  • right_*
    • right_*, front_*, back_*, up_*, down_*, zoom_*, unzoom_* parameters set following left syntax.
    • REQUIRED data
      <view... limitview="range" hlookatmin="..." hlookatmax="..." vlookatmin="..." vlookatmax="..." fovmin="..." fovmax="..." fov="..." hlookat="..." vlookat="...".../>
      in each xml panorama file!!!
  • goto_delay
    • Delay (s) before to raise goto hand position.
  • goto_motion
    • Motion used during goto hand position.

kx_styles_?.xml, styles file

Styles file collection, used in the tour:
- Set in kx_config.xml or using HTML command line {t.sty} parameter.
- For textfields, plugins, hotspots, icons and soundinterface.
- Regarding styles, all standart (krpano's) attributes are managed like align, height, width... but not described here!

Header, {About} informations:

<kx_about_styles
        _libel="Full, Production"
        _date="2012/03"
        _version="0.9j"
/>

Exported Attributes:

<info_css (example of CSS's name!)
        ...
        backgroundalpha="0.4"
        ...
/>

<style_name="..."
        ...
/>

<kx_graphics 
        icons_add="true" 
        icons_align="centerbottom"
        icons_register="0.7"
        icons_onstage="1.0"
        icons_off="0|0|530|360"
        icons_on="530|0|530|360" 
        ...
        icons_ox="0"
        icons_oy="79"

        icon_center="3d_center_f"
        ...

        body_cursors="kx_cursors"
        ...

        hand_cursors="kx_cursors"
        ...     
/>

<kx_sounds 
        sound_add="true" 
        sound_suffix="sound"
/>

info_css (example of CSS's name) attributes

kx_graphics attributes

  • icons_add
    • When set to "true", a set of plugins, which represents the visitor's status/actions, is added and kept in all panoramas.
      • Example of set, inactive / active:icons
  • icons_align
    • Alignment / origin-point position of the icons on the screen.
      Possible values: lefttop, left, leftbottom, top, centerbottom, righttop, right, rightbottom.
      • edge is fixed to center.
  • icons_register
    • Icons's alpha value / transparency during visitor's "register" phase.
  • icons_onstage
    • Icons's alpha value / transparency when visitor's is on stage.
  • icons_off
    • Icon's crop definitions="x-position|y-position|width|height" waiting visitor's action.
  • icons_on
    • Icon's crop definitions="x-position|y-position|width|height" during visitor's actions.
  • icons_ox
    • Icon's x offset based on icons alignment.
  • icons_oy
    • Icon's y offset based on icons alignment.
  • icon_*
    • Visitor's status/actions icon's filenames:
      • Icon_center, icon_left, icon_right, icon_front, icon_back, icon_up, icon_down, icon_zoom, icon_unzoom
    • The location and name must be {kx_config.path}/graphics/{icon_*}.png
  • body_cursors*
    • Body's cursors filename and definitions:
      • 8way crop manageable.
    • The final location and name must be {kx_config.path}/graphics/{body_cursors}.png
      • Example:
        body_cursors
  • hand_cursors*
    • Hand's cursors filename and definitions:
      • 8way crop manageable.
    • The final location and name must be {kx_config.path}/graphics/{hand_cursors}.png
      • Example:
        hand_cursors

kx_sounds attributes

  • sound_add
    • When set to "true", a kx_p_{sound_suffix} plugin is added and kept in all panoramas.
        • See {About}.
        • Manageable thru plugin[kx_p_{sound_suffix}].*

kx_texts_?.xml, texts file

Texts/Languages messages collection displayed in the tour.
- Normaly defined by HTML command line {u.txt} parameter (browser/user language),
- or using HTML command line {t.txt} parameter.

Header, {About} informations:

<kx_about_texts
        _libel="English, Production"
        _date="2012/03"
        _version="0.9j"
/>

Exported Attributes:

<kx_texts 
        ...
        register_id="info" 
        register_html="[p]Hello,[/p][p]I'm happy to see you!
            [/p][p]Come on center place![/p]"
        register_css="info_css"
        register_background="true"
        register_delay="NaN"
        register_count="NaN"
        register_wait="true"
        ...
        *_*="..." 
        ...
/>

kx_texts attributes

  • register_id
    • Combined with kx_display_html() add a textfield plugin named kx_p_{register_id} = kx_p_info and kept in all panoramas.
        • Manageable also directly thruplugin[kx_p_{register_id}].*
          (example: plugin[kx_p_info].*)
  • register_html
    • HTML text to display.
  • register_css
    • CSS style to apply, defined in {kx_config.path}/styles/kx_styles_{kx_config.styles}.xml
  • register_background
    • Set to "true", add a kx_pb_{register_id} (example: plugin[kx_pb_info].*) transparent background plugin to kx_p_{register_id}.
      • A same kx_p_{register_id} textfield plugin can be displayed with or without kx_pb_{register_id} background plugin.
    • Linked to kx_styles.backgroundalpha
    • Example:
      • kx_display_html(register);
<info_css
      title="p{color:#ff7700;
            font-family:Arial; 
            font-size:64;
            font-style:italic;
            font-weight:bold; 
            text-align:center}"
      autosize="center"
      align="centercenter" 
      height="300" 
      width="1100" 
      x="0" 
      y="0"
      alpha="1.0"
      roundedge="5"
      background="true"
      backgroundcolor="0xffffff"
      backgroundalpha="0.4" 
      borderdcolor="0x000000"
      borderwidth="0"
      effect="glow(0xFFFFFF,0.2,2,2);
            dropshadow(4,40,0x000000,4,1);"
/>

<kx_texts
      ...
        register_id="info"
        register_html="[p]Hello,[/p][p]I'm happy to see you!
            [/p][p]Come on center place![/p]"
        register_css="info_css"
        register_background="true"
        register_delay="NaN"
        register_count="NaN"
      ...
/>
      • Display result:

register_stage

    • HTML text display delay (s).
      • Fixed to "NaN", the HTML is never automatically hide.
  • register_count
    • Number of HTML display for the same visitor in the current tour.
      • Fixed to "NaN", the HTML is always displayed.
  • register_wait
    • Freeze the tour during the delay when "true".
      • Default value is no value
  • *_*
    • HTML texts definitionsfollowing same {kx_texts.register_*} syntax:
      • entry, exit, center, left, right, hrz, front, back, vrt, up, down, zoomon, zoomoff, zoom, unzoom, body, hand.

kx_library_?.xml, customer's application file

Krpano XML code to extend tour's actions:
- In it, you can add all your shared code actions.
- Nevertheless some actions are required..

Header, {About} informations:

<kx_about_params
        _libel="jphd360, Production"
        _date="2012/03"
        _version="0.9j"
/>

Exported Attributes:

Already defined actions
        kx_init_pano();
        kx_register();
        kx_entry();
        kx_exit();
        ...;

kx_library_?.xml

...
<!--************ Panorama Initialization *************-->
<!-- KINECT Customer's Init_Pano Action
<!--**************************************************-->
<action name="kx_init_pano">
	if(kx_config._log,
		trace("action: kx_init_pano();");
	);
	... add your code here, or do nothing but should be defined!!!
</action>
...
  • kx_register();
    • MANDATORY
    • Action always raised, one time for each visitor, by internalregister(); action (at the end) when visitor is detected on the stage.
    • Code example:
...
<!--************ Panorama Initialization *************-->
<!-- KINECT Customer's Register Action
<!--**************************************************-->
<action name="kx_register">
	if(kx_config._log,
		trace("action: kx_register();");
	);
	... add your code here, or do nothing but should be defined!!!
</action>
... 
  • kx_entry();
    • MANDATORY
    • Action always raised, one time for each visitor, by internalentry(); action (at the end) when visitor is on center of stage.
    • Code example:
...
<!--************ Panorama Initialization *************-->
<!-- KINECT Customer's Entry Action
<!--**************************************************-->
<action name="kx_entry">
	if(kx_config._log,
		trace("action: kx_entry();");
	);
	... add your code here, or do nothing but should be defined!!!
</action>
...
  • kx_exit();
    • MANDATORY
    • Action always raised, one time for each visitor, by internalexit(); action (at the end) when visitor leaves the stage.
    • Code example:
...
<!--************ Panorama Initialization *************-->
<!-- KINECT Customer's Exit Action
<!--**************************************************-->
<action name="kx_exit">
	if(kx_config._log,
		trace("action: kx_exit();");
	);
	... add your code here, or do nothing but should be defined!!!
</action>
...

kx_styles_?.xml, virtualtour?.xml files

Here an example of a couple styles and panorama xml files:

kx_styles_?.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- for xml compliance -->
<krpano version="1.0.8.14"> ... <style name="hotspot_front" bordercolor="0x00ff00" borderalpha="1" fillcolor="0x00ff00" fillalpha="0.25098" bordercolorhover="0x00ff00" borderalphahover="1" fillcolorhover="0x00ff00" fillalphahover="0.25098" /> ... </krpano> virtual_?.xml <?xml version="1.0" encoding="UTF-8"?>
<!-- for xml compliance -->
<krpano version="1.0.8.14"> <!--************* onload action **************--> <!-**** Call special kinect fucntions ********--> <events onloadcomplete="onloadcompleteaction();"/> <action name="onloadcompleteaction">
kx_load_pano();
</action> <!--**************** View *******************--> <!-** REQUIRED by special kinect fucntions ***--> <panoview h="0" v="0" fov="120"/> <progress showload="none" showwait="no"/> <!--************** Parameters ***************--> <!-** REQUIRED by special kinect fucntions ***--> <view fisheye="0" hlookat="0" vlookat="0" fov="120" limitview="range" hlookatmin="-180" hlookatmax="180" vlookatmin="-90" vlookatmax="90" fovmin="45" fovmax="120" fovtype="HFOV" /> <!--************** Thumbnail ****************-->
<preview
url="virtualtourdata/virtualtour0/preview.jpg"
type="CUBESTRIP"
striporder="FRBLUD"
details="16"
/> <!--************** Panorama ****************-->
<image type="CUBE" multires="true" tilesize="988" baseindex="0">
<level tiledimagewidth="1976" tiledimageheight="1976">
<left url="virtualtourdata/virtualtour0/3/1/%v_%u.jpg"/>
<front url="virtualtourdata/virtualtour0/0/1/%v_%u.jpg"/>
<right url="virtualtourdata/virtualtour0/1/1/%v_%u.jpg"/>
<back url="virtualtourdata/virtualtour0/2/1/%v_%u.jpg"/>
<up url="virtualtourdata/virtualtour0/4/1/%v_%u.jpg"/>
<down url="virtualtourdata/virtualtour0/5/1/%v_%u.jpg"/>
</level>
<level tiledimagewidth="988" tiledimageheight="988">
<left url="virtualtourdata/virtualtour0/3/0/%v_%u.jpg"/>
<front url="virtualtourdata/virtualtour0/0/0/%v_%u.jpg"/>
<right url="virtualtourdata/virtualtour0/1/0/%v_%u.jpg"/>
<back url="virtualtourdata/virtualtour0/2/0/%v_%u.jpg"/>
<up url="virtualtourdata/virtualtour0/4/0/%v_%u.jpg"/>
<down url="virtualtourdata/virtualtour0/5/0/%v_%u.jpg"/>
</level>
</image> <!--*************** Hotspots ****************--> <!-* Hotspot name : {kx_config.prefixhspot}{number} *-->
<hotspot name="spot1"
hview="-145"
vview="0"
fovview="120"
hcenter="8.49666"
vcenter="-9.61973"
handcursor="false" <!-***** Call special xkinect fucntions ******-->
onclick="kx_hotclick(1);"
onhover="kx_autoclick();"
onout="kx_resetclick();" <!-** Apply defined style in kx_styles.xml ***-->
style="hotspot_front">
<point ath="367.481" atv="-24.3268"/>
<point ath="352.335" atv="5.08736"/>
<point ath="384.659" atv="4.90236"/>
</hotspot>
</krpano>