Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  JavaScript FAQ's    Can I use JavaScript to reset the camera back to its original position?

Read-Only Read-Only Topic
Go
New
Find
Notify
Tools
-star Rating Rate It!  Login/Join 
<Viewpoint>
Posted
We can't quite get the camera object to reset back to its original coordinates. Right clicking is always an option to reset, but we want to be able to assign the reset to a button via javascript. The animations within the camera object we can reset to their original positions no problem. But the whole camera won't return to its original coordinates.
 
Report This Post
<Viewpoint>
Posted
If you have the javascript MTX2HTML creates, you should call resetcamera() and it will reset the camera. The javascript would look like this:

< !--

var isIE4 = navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion.substring(0,1)) >= 4;

function mtspluginfunction()

{

var argstr;

argstr = mtspluginfunction.arguments[0] + "(" + arguments[1] + ")";

if (isIE4) document.all.MetaStreamCtl.PluginCommand(argstr, 0, 0);

else document.MetaStreamCtl.DoCommand(argstr);

}

function resetcamera() {mtspluginfunction ("ResetCamera", arguments[0]);}

//-->
 
Report This Post
  Powered by Eve Community  

Read-Only Read-Only Topic

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  JavaScript FAQ's    Can I use JavaScript to reset the camera back to its original position?