VRT consists of a suite of seven editors that can be used to build a virtual world:
The Image Editor can load, save, edit and create images for use in a virtual world. These images can be applied to objects as textures or used as backdrops and instruments in the Layout Editor.
The Resource Editor can create menus, alert boxes and dialog boxes to communicate with the user. Unfortunately the Resource Editor in VRT Version 5.01 is always crashes as soon as the user tries to edit something.
In addition VRT includes the SCL (Superscape Control Language) an easy-to-use control language that it can be used to control objects in the virtual world and perform actions that could not be performed by the automatic rotations or movement functions. SCL programs are attached to an object, and executed every frame.
VRT also includes two visualization platforms that display the virtual worlds:
Superscape’s real-time 3-D Web browser. Viscape is
incorporated within Superscape VRT, and available as a plug-in for Netscape
Navigator or ActiveX control for Microsoft Internet Explorer.
Method
The model of the milling machine was made in 3D Studio Max V3.0 and then all the parts were converted to DXF format in order to import them in the World Editor (Data converter supports only DXF format). Each of these objects (parts) was saved separately as a shape file (SHP) in the Shape Editor. Then all the shapes were loaded in the Shape Editor and saved as a single shape file after they were manipulated (dimensions, colours, lights, ordering of facets). Before VRT draws a shape it must determine the order in which to render the facets that make up the shape. The facets further away from the viewpoint must be drawn first, so that the nearer facets are drawn after to obscure them. The fact that the objects were imported (they have very large number of facets, e.g. a robot’s part has 336 facets) made very difficult the ordering and some parts on the milling machine and the robot do not look nice. Afterwards each shape made an object in the World Editor (In the world editor each object is made up of a shape) and all together assembled the milling machine, the robot, the desk, and the room.
Motion was added to the Milling Machine’s guard and drawer and to the Robot’s gripper by using the simple automatic rotation and movement functions.
In order to be able to rotate the monitor next to the milling machine the following SCL program was necessary:
short
mx, my;
fixed
rx, ry;
resume
(1, 0);
if
(activate (me, 0))
{
mx=mousex;
my=mousey;
ry=yrot
(parent (me));
while
(mouseb)
{
set
(1);
yrot
(me)=ry+mousex-mx;
waitf;
}
reset
(1);
clrtrig
(me, 0);
}
In
order to link the rotation of the monitor to the output of some instruments the
following lines should be added as well:
instr
(8)=yrot (me);
instr (9)=yrot (me);
The sound Editor was used to add a sound in the world. Sounds can only be triggered in Visualiser using SCL.
if
(activate (me, 0))
sound
(1, 64, 127, 0);
The sound plays only when the robot’s gripper is activated. In order to be able to hear the sound you will need to enable the sound device:
Visualiser > Settings > Setup… > Sound > Enable > OK
The following lines were added in the guard and drawer to display information when activated
if
(activate (me, 0))
instr
(5)=" Press F12 to see how
this object moves ";
(Guard)
else
instr (5)=" ";
if
(activate (me, 0))
instr
(4)=" Press F12 to see how
this object moves ";
(Drawer)
else
instr (4)=" ";
A message is displayed in the Visualiser when the user triggers an object that do not move and has no instruments associated to it. For that to take place the following SCL program were added in each of these objects.
resume (0, 2);
if (activate (me, 0))
{
ccel (me, 1)=2;
waitf;
alert ("(This Project is not finished
yet)", 0);
ccel (me, 1)=1;
clrtrig (me, 0);
}
Four icons and four extra windows were added in the Layout, each one with a different view. A foredrop was made in Photoshop and imported in the Layout Editor as well.
In order to import the world in a web page visible with Microsoft Internet Explorer or Netscape Navigator the following lines should be added in the web page’s HTML code:
<CENTER>
<OBJECT
CLASSID="clsid:1B487523-BEC2-11CF-BF9E-0020AF998FF5"
WIDTH=512
HEIGHT=384 align="center" border="8" id="VirtualMachine">
<PARAM
NAME="World" VALUE="Assignment1.svr">
<embed
SRC="Assignment1.svr" WIDTH="512" HEIGHT="384">
</OBJECT>
</CENTER>
Bibliography