<script language="JavaScript" src="/js/Kribi3DPlayer.js" type="text/javascript"></script>

    <script language="JavaScript" src="/js/gFunct.js" type="text/javascript"></script>

   

    <script language="JavaScript" type="text/javascript">

 

        var loadok = false;

        var opening = false;

 

        /* ------------------------------------------------------------ */

        /* This function is invoked when the page is loaded.

        *Allows the loading of plugins*/

        window.onload = function() {

        loadok = true;

        }

 

        /* ------------------------------------------------------------ */

        /* This function is invoked every time the player sends a message to the

        * browser, we use it to intercept the Ready event which is sent when

        * the player is ready to accept commands and the ModelOpened event which is

        * sent when the model has been loaded. */

        function KribiPlayer_Tell(msg) {

            var player = document.getElementById("KribiPlayer");

            if (loadok) {

                if (msg == "ModelOpened") {

                    // initialize the camera.

                    DefaultView_init();

                } else if (msg == "Refresh") {

                    if (!opening) {

                        // Wait for all the controls to be opened, make sure that this will run only once.

                        opening = true;

                        player.Do("Model OpenAsync '" + FullModelsPath() + "Flat2LevelV04_OP.kmo'");

                    }

                }

            }

        }

 

        /* ------------------------------------------------------------ */

        // Set default

        function DefaultView_init() {

            var player = document.getElementById("KribiPlayer");

            // Set the camera to its initial position.

            player.Do("Camera Position 3022.8,3536.32,1455.1");

                  player.Do("Camera Orientation 414.678,33.518,0");

                  player.Do("Camera FieldOfView 71.00");

            // Enable realistic rendering.

                  render_Realistic();

                  // Set tool

            CameraPan();

        }

 

        /* ------------------------------------------------------------ */

        // Tools

        function CameraPan() {

            // Set Tool CameraPan

            var player = document.getElementById("KribiPlayer");

            player.Do("Tool SetCurrent 'CameraPan'");

        }

        /* ------------------------------------------------------------ */

        function CameraPlaneMove() {

            // Set Tool CameraPlaneMove

            var player = document.getElementById("KribiPlayer");

            player.Do("Tool SetCurrent 'CameraPlaneMove'");

        }