This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > VRML > November 2005 > Dynamically add a new viewpoint [Please help]
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Dynamically add a new viewpoint [Please help]
|
|
| Ms Need Help! 2005-10-30, 3:15 am |
| Hi all,
I've been trying to figure out how to add a new viewpoint and switch to it by
clicking buttons. The tool I've been using is the Cortona VRML SDK 4.0. Based
on the its sample, I have the following code embeded in a HTML file. But
everytime I ran it, it gave this error message "Undefined node type undefined
Viewpoint". Does anyone know how to fix it? Or anyother alternatives for this
function? Thanks a lot in advance. Your help is appreciated!
<html>
<head>
<script language="javascript">
function addViewpoint()
{
var syn ;
syn += "DEF newView Viewpoint {\n";
syn += "position 0.947680 0.977153 -6.774433 \n";
syn += "orientation -0.015998 0.998502 0.052327 2.549019 \n";
syn += "fieldOfView 0.950010 \n";
syn += "description \"newView\" \n";
syn += "jump TRUE \n";
syn += "}\n";
var aNode=Cortona.Engine.CreateNodeFromString(syn); /*Cortona is the id of the
VRML file embeded*/
Cortona.Engine.RootNodes.Add(aNode);
}
</script>
</head>
<body>
<object classid="clsid:86A88967-7A20-11d2-8EDA-00600818EDB1" id=Cortona
TYPE="application/x-oleobject" width="600" height="450"
codebase="http://draft.paragraph.ru/bin/cortvrml.cab#Version=4,0,0,76" >
<param name="scene" value="LaBoite_II_withSource.wrl" ref>
<param name="vrml_background_color" value="#dcdcdc">
<param name="vrml_dashboard" value="FALSE">
<param name="ColliderMode" value="0">
<param name="NavigationBar" value="1">
<param name="ConsoleMode" value="0">
<param name="ShowFps" value="0">
<param name="ShowRenderingTime" value="0">
<param name="ShowProgress" value="-1">
<param name="WaitForAllResources" value="0">
<param name="RendererName" value="DirectX Renderer">
<param name="RendererHints" value="1024">
<param name="Collider" value="-1">
<param name="HeadLight" value="1">
<param name="NavigationMode" value="1">
<param name="viewpoint_transition_mode" value="0">
<param name="show_hidden_viewpoints" value="0">
<param name="TravelSpeed" value="2">
<param name="BackColor" value="14474460">
<param name="ShowLogo" value="0">
<param name="ContextMenu" value="-1">
<param name="Mask" value>
<param name="LoadDroppedScene" value="-1">
<param name="MuteSound" value="0">
<param name="Appearance" value="0">
<param name="CpuLoading" value="80">
<param name="RendererOptimization" value="1">
<param name="Skin" value="{1706B265-E103-4332-9871-7FEE6C37C699}">
<param name="NavigationStyle" value="plan">
<param name="NavigationType" value="WALK">
<param name="InputDevices" value="7">
</object>
<form name = "f1" action="--WEBBOT-SELF--" method="POST">
<input type="button" value="Click Me" name="buttonClick"
onclick="addViewpoint();">
</form>
</body>
</html>
| |
| 大宋(big sung) 2005-11-14, 4:19 am |
| oh ,my dear
i just advice you to learn javacript with SCRIPT,it also can do the job
using "creatnodewithstring".
first you ought to write a wrl which do the job to add a new node,and
then write a html or asp emmbed the wrl file. i think you can do it well
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|