<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() + "offroadbrickV03_OP.kmo'");
}
}
}
}
/*
------------------------------------------------------------ */
//
Set default
function DefaultView_init() {
var player = document.getElementById("KribiPlayer");
// Set the camera to its initial position.
player.Do("Camera Position
3935.24,1104.01,1049.08");
player.Do("Camera Orientation
20.1968,24.4939,0");
player.Do("Camera FieldOfView 71.00");
// Enable realistic rendering.
player.Do("Renderer Shading Realistic");
// Set tool
CameraOrbit();
}
/*
------------------------------------------------------------ */
// Tools
function CameraOrbit() {
// Make the camera orbit around the scene
center.
var player = document.getElementById("KribiPlayer");
player.Do("Tool SetCurrent 'CameraOrbit'");
player.Do("ToolsPreferences OrbitMode Pick");
var dd1 = player.Do("Tool
GetCurrent ");
}
/*
------------------------------------------------------------ */
function
CameraOrbitCenter() {
// Make the camera orbit around the scene
center.
var player = document.getElementById("KribiPlayer");
player.Do("Tool SetCurrent 'CameraOrbit'");
player.Do("ToolsPreferences OrbitMode
ObjectCenter");
var dd = player.Do("Tool
GetCurrent ");
}
|