Home
Virtual Reality Applications
Contents
1. Controls the incoming node path if any of the intsance s movable parts lies in it If so is activates a task HHRotationTask which rotates the geometry accordingly THIS METHOD DOES NOT WORK BECAUSE WTK DO NOT SUPPORT VRML 2 0 PROPERLY xy void HHRotation97 chkNode WtNodePath nodePath int currentNodeNum WtNode currentNode currentNodeNum nodePath NumNodes 1 char name while 0 lt currentNodeNum currentNode nodePath gt GetNode currentNodeNum if NULL currentNode name currentNode gt GetName if turret currentNode NULL name amp amp 0 strcmp name Turret if taskRunning if taskElevate currentAngle 60 taskElevate FALSE else currentAngle 0 taskElevate TRUE taskRunning TRUE rotationTask new WtTask this HHRotation97 HHRotationTask break currentNodeNum Returns the midpoint of the geometry EL WtP3 HHRotation97 getMidpoint WtP3 midpoint WtGroup whole gt GetMidpoint midpoint 75 return midpoint OK HK KK kok kok k oko k oko kok kok k ko kok k k kok k I kok kok k kok k k kok A kok k k kk A kk k k kk k kk k kk kk I STATIC METHODS kk BR K K k k k k kok k oko k k k k kok k k kok k k kok k k kok k kok kok kok k k k k k kok k k kok k k k k k kok k k k k k k k k kk k kk k kk k kk I The rotation task function for HHRotation97 s turret geometry
2. static void HHActionFn static void HHDrawFn WtWindow win FLAG eye static void HHFgDrawFn WtWindow win FLAG eye static void HHDemoTask void myApp private void displaySplash void updateMHandler void resetViewport void rotateViewport float radians void zoomViewport float transZ void completeScene void rockNroll int thatOne void demoMode void radar int part int positive HHGeometry myGeometry A geometry class of some sort WtRoot myRoot The root node to the primary scene graph WtViewPoint myView The viewpoint to the primary scene graph WtWindow myWindow The window to the primary scene graph HHMouseHandler myMHandler The mouse handler which is a HHScreamer WtP3 origPos Original position of the viewpoint WtQ origOrient Original orientation of the viewpoint HHManualState currManState Current state of the manual BOOL demoOn Is the application in demo mode WtTask demoTask The task that handles the demo animations int viewPortCount currentTurret radarCount headCount Counters for the demo loop BOOL countUp radarUp headUp Direction flags up down for the counters 53 endif UT TTL T TL T L TL T L L TT T HHVirtualManual cpp The application T T T T T P P Pl lll M E P g MI gg include HHVirtualManual h kok k k k k kok k Ck kk Ck k kk Ck k kk k kk k k kk Ck kok k k kok Ck k k
3. C HHMissile m Figure 5 7 Recommended design of the geometry classes Each of the movable parts is separated into different classes In this manner each class handles it s own geometry instead of one large class handling all of the different geometries HHBamse still loads the geometry from a single file separates the geometry into the different movable parts and instances classes that encapsulates the parts The HHVirtualManual still only has access to HHBamse and thus HHBamse has to coordinate the behaviors of the different parts 5 3 Execution When the application is executed HHVirtualManual initiates all WTK attributes and instantiates an HHBamse and an HHMouseHandler The HHBamse instance then loads the BAMSE geometry and initiates the movable parts of the geometry as described above WTK has an internal program loop that every application must follow This is illustrated in Figure 5 8 39 Figure 5 8 The WTK program loop This program loop designed for C programs poses a problem when making an object oriented design The universe s action function located in box number two in Figure 5 8 is the major function that is called in each program loop In this function all logical operations have to be performed The problem is that C does not have functions it has methods that are part of classes and WTK expects a function The solution is to either write a special function for the progr
4. IntroductlOTi iios eee ce se ro roses Ge ea eee no rese sics ea s ceno pa aea Co aeo co sa pode va eee u ee cosa re sues does ecvesasesesa L 1 1 1 2 1 3 1 4 Simulauon visualzatiOte s oos CERIS IS ds ere AON a EE HR NEUEN ANE ME 1 hree dimensional Srapho S03 evn acdc Rss r RR sada oka ob o sd eee 1 Virtual Rel Ses sot cor Ae restore heed Pcs ad ea suec actui foe etre nea rcc SU S 3 1 3 1 Head Mounted Displays 1 3 2 Virtual Reality Gloves 1 3 3 Trackers About tHE THESIS PET T rs lo es set catia reacted SR Se SNRA RASA AN mettre 4 Background and 20215 sss slesossvdsvosd s socssossess s ovdosossssosseesocsessssssesses rssnsererssseseosessesersssserer 2 1 2 2 Joris ducere DE C TRI 6 ari aka edu Ada 6 Method and requirements ds ama va depre neos es aane co duas es vo cd eux Y ena aere daa Ae one nn 3 1 32 33 IR OUI mieblls 45 coo ree Oven ois dinis tUa n 064000 ae E ds 8 3 2 1 Level of abstraction 3 2 2 Connection to I DEAS 3 2 3 Hierarchical transformation 3 2 4 Rotation in any chosen point 3 2 5 Different levels of immersion Concerning the FESO 303356 inv ess catud n at uad ebat edu tuc DE E 10 CILE PIE MI 4 1 4 2 World ToolKit sS A dn Doe o SN SS 11 4 1 1 Level of abstraction 4 1 2 Connection to I DEAS 4 1 3 Hierarchical transformation 4 1 4 Rotation in any chosen point 4 1 5 Different levels of immersion 4 1 6
5. R Root node Light L ms G Group node Transform T S Shape node node Figure 1 2 A simple scene graph A scene graph is a directed acyclic graph The graph in Figure 1 2 is an example that contains five different nodes These are the most common nodes but the different types of nodes can vary from system to system A group node is a node which does not have any attributes in itself but can have children The root node is basically a group node without any parents thus being the group node of the whole scene Light nodes contain light attributes for the scene A transformation node determines the placement and orientation of the geometry which is contained in the shape node 1 3 Virtual Reality Virtual Reality VR was a fashion word a couple of years ago when the Internet began to grow People thought that within the next decade everybody was going to live on the Internet in a virtual reality Since then not much has happened that has reached the public audience Surely the Internet is bigger than ever but its citizens still use an ordinary computer to interact with each other The technology to immerse oneself within the virtual world exists but it is still too expensive for ordinary consumers Immerse is one of the keywords that surround VR since it can be thought of as a technology to increase the level of immersion in visualizations Immersion in the context of VR is basically the cognitive conviction of being
6. iHHPoleTask SHHMissileTask sfkturret Rotation sillipoleRotation sin eadRotation zf topRotation wPradarRotation wscreenRotation sfcompute Turrets com puteP ole ws eparateTop o HHRadarTask iHHScreenTask 0 Figure 5 6 The detailed design of the Bamse geometry class HHBamse works in the same way as HHRotation2 i e it loads the whole geometry a BAMSE unit from a single file and then separates the movable parts The HHBamse geometry contains several movable parts two missiles turrets a missile the turret base the radar pylon and the radar disc All of these are localized in the scene graph and converted into movable geometry The HHVirtualManual can then invoke methods through the HHGeometry interface to rotate the different parts and shoot missiles The design of the HHBamse class is not recommended for a real application It is only used here since the whole structure is designed to be used as an evaluation of WTK s functions There are too many different aspects that are encapsulated in a single class It is recommended to move these aspects into several separate classes to better utilize the object oriented paradigm An example of one such structure is shown in Figure 5 7 38 TRL Z wol LOT ae E NEUE MM NI iul E N 2 i HHTumet EN C HH Radar B 7s m ylon _ i 4 lt
7. gt AddChild missile else WtGroup right gt AddChild missile switch whichOne case 1 mTranslation 0 40 f mTranslation 1 62 f mTranslation 2 0 f break case 2 mTranslation 0 40 f mTranslation 1 42 f mTranslation 2 0 f break case 3 mTranslation 0 40 f mTranslation 1 62 f mTranslation 2 60 5f break case 4 mTranslation 0 40 f mTranslation 1 42 f mTranslation 2 60 5f break WtMovable missile gt Translate m Translation WTFRAME LOCAL WtMovable missile gt MovAxisRotation Z PI 6 f WtMovable missile gt GetTransform missileTrans WtMovable motor gt GetTransform motorTrans WtMovable missile gt GetTranslation mTranslation WtMovable motor gt GetTranslation moTranslation missileRun TRUE 90 missileSeparated FALSE missileCount 0 motorAngle 0 f missileTask new WtTask this HHBamse HHMissileTask 1 f return TRUE return FALSE The task function that handles the movement of the missile t void HHBamse HHMissileTask void myRotation WtNode temp temp HHBamse myRotation gt motor WtMovable temp gt SetTransform HHBamse myRotation gt motorTrans temp HHBamse myRotation gt missile WtMovable temp gt SetTransform HHBamse myRotation gt missileTrans if HHBamse myRotation missileSeparated HH
8. 48 i Price class 6 900 11 900 1 795 399 3499 1 799 4 000 160 000 SEK 1 500 4 000 7 995 11 995 795 299 A 2 Gloves Vendor eality Inc A 3 Trackers Vendor scension Technology Products Price class 5th Glove 500 2 000 5th Glove 14 Sensor 4 000 CyberGlove Pinch Gloves Table A 2 Gloves Products Price class Flock of Birds MotionStar MotionStar Wireless peBIRD SpacePad FastTrak IsoTrak II Star Trak 15 300 15 600 Mark 2 Plus 15 900 i InterTrax Table A 3 Trackers 49 B Glossary 3D 3 dimensional API Application Programming Interface Bamse an anti aircraft defence system that SAAB Bofors Dynamics develops CAD Computer Aided Design CAE Computer Aided Engineering Cave a VR projection system where a cube surrounds the user with projections on several or all of the walls Direct3D a 3D graphics API developed by Microsoft Directed acyclic graph a graph e g a scene graph that is directed 1 e it s nodes direct to order of the graph and acyclic i e there cannot be cycles in the node structure EAI External Authoring Interface External Authoring Interface an interface that allows external programs to communicate with VRML scenes Gizmo a wizard i e a program guide in Realax Glove a VR input device consisting of a glove equipped with sensors GUI Graphical User Interface
9. Computer Science Henrik Hedlund Virtual Reality Applications Evaluation of Development Environments Bachelor s Project 2000 06 Virtual Reality Applications Evaluation of Development Environments Henrik Hedlund 2000 Henrik Hedlund and Karlstad University This report is submitted in partial fulfillment of the reguirements for the Bachelor s degree in Computer Science All material in this report which is not my own work has been identified and no material is included for which a degree has previously been conferred Henrik Hedlund Approved 00 05 31 Advisor Hua Shu Examiner Stefan Lindskog iii Abstract This thesis is the documentation of a Bachelor s project at the Department of Computer Science Karlstad University for SAAB Bofors Dynamics It contains an overview and evaluation of six different Virtual Reality development environments that could be of use to future Virtual Reality developments at SAAB Bofors Dynamics The evaluation discusses the pros and cons of each development environment and in what way it could be valuable to SAAB Bofors Dynamics A conclusion is then reached and recommendations are presented This thesis also documents the implementation of a testbed that has been created using one of the evaluated development environments This testbed is an example of how a three dimensional computerized demonstration or manual can be designed and constructed Contents 1
10. Head Mounted Display a pair of glasses or a helmet that utilizes stereographic viewing to produce a visual 3D effect HMD Head Mounted Display HTTP HyperText Transfer Protocol OpenGL Open Graphics Library low level graphics API developed by SGI Industry standard used in several CAD and 3D applications Open source the source code is freely available for anyone who wants it I DEAS a CAD system that SAAB Bofors Dynamics uses Homepage Attp www sdrc com Immersion the cognitive conviction of being inside a 3D scene PROTO node a prototype node in VRML that is used to describe other specialized nodes Render to generate an image from a 3D scene that will be displayed on a 2D screen Scene graph a hierarchical representation of a 3D graphics scene SDK Software Development Kit SGI Silicon Graphics Inc 50 Shutter glasses see stereo glasses Simulator sickness disturbances such as headaches nausea and vomiting produced by simulators Stereo glasses LCD screens that are linked to the frame rate of a monitor to produce a stereographic effect Stereographic viewing the use of two images of the same scene where one is presented to the left eye and the other to the right eye Tracker a VR input device that tracks the user s motions Translation the position of a geometry in a coordinate system to translate to position a geometry in the coordinate system Vertex The smallest component of a 3D scene consisting o
11. radar gt SetTransform radarTrans SetTransform screenTrans WtMovable missile SetTransform missileTrans WtMovable motor SetTransform motorTrans translation 0 31 f translation 1 0 translation 2 0 WtMovable top gt Translate translation WTFRAME LOCAL WtMovable top gt MovAxisRotation Y angle translation 0 1 WtMovable top gt Translate translation WTFRAME LOCAL WtMovable head gt SetTransform h WtMovable pole gt SetTransform p WtMovable left gt SetTransform l1 WtMovable right gt SetTransform r WtMovable radar gt SetTransform rd WtMovable screen gt SetTransform s Rotates the radar head the given angle Ri void HHBamse WtM4 s radarRotation float angle WtP3 translation WtMovable WtMovable screen gt GetTransform s radar gt SetTransform radarTrans 86 WtMovable screen gt SetTransform screenTrans if radarAngle angle lt 3 PI angle 3 PI radarAngle else if radarAngle angle gt 3 PI angle 3 PI radarAngle radarAngle angle translation 0 5 f translation 1 0 f translation 2 0 f WtMovable radar gt Translate translation WTFRAME LOCAL WtMovable radar gt MovAxisRotation Y radarAngle translation 0 1 WtMovable radar gt Translate translation
12. t 0 ETD t 0 t 0 t 0 t 0 E 0 t 0 t 0 t 0 t 0 25 38f 38f 001f 001f DOTE 001f 001f 001f 52 52 52 52 52 52 52 52 52 52 52 75 0 95f 0 94f oo oo O oOo Ss o oo 0 0 BOf 49f 46 42f 38 88f 87 84 82 78 74 DE 68 66 64f 62 84 82f 80f 78 76 74 SIDE 70 BOFORS BAMSE Hastighet Man verbarhet Effektiv r ckvidd Effektiv Styrntingi y Verkansdel Ta ndror y M ltyper H g hastighet hela r ckvidden Mycket stor inom rackvidden L5 31 ek ey Upp till 15 000 Kombinerad RSV laddning Zonror och Attackflyg bomb attack och standoff missiler etc och BAMSE MCC Funktion Hydda Skydd ys Bes ttning M lf ljningsradar Frekvens R ckvidd Andra sensorer IK Stridsledning och Dragen luft transportabel Mot splitter och stridsmedel 1 2 Baserad p win gt Draw2DText 0 75f 0 68f Ka K band 34 35 GHZ win gt Draw2DText 0 75f 0 66f 30 km win gt Draw2DText 0 75f 0 64f IRV kamera v dersensor win gt Draw2DText 0 75f 0 62f Inbyggd IK antenn break This task is run during the demo mode It rota
13. 5 2 c and 5 2 d shows the BAME unit firing missiles immm i mdi gee mr Ent a Prem E a b EEE C R c d Figure 5 2 A Bamse unit shown in different situations When pressing the space key the application enters a demo mode In this mode the program basically runs in a demonstration loop where all the effects are displayed The 33 viewport zooms in and out the model rotates the radar angles and rotates the turrets elevate de elevate and shoot missiles and all the information about the different BAMSE parts are showed each in turn 5 2 Design and structure The following diagram illustrates the object oriented design used in the implementation of the testbed A 28 NG ister B screams a A M LV i Uv i HHGeomety Uu HmouseHa gt po nual Po ndler prm ae Y laum HHBamse T m C ELS bna P xi A 7 ke HHRotation pe J 7 A L E NLA Figure 5 3 The design of the testbed There are two major areas in the structure input handling and geometry handling They are described in turn The input handling is only designed to handle an ordinary mouse It is possible to extend the design to enable the handling of other types of input devices but this was not necessary for this testbed WTK has built in functions to handle the mouse and it is possible to map the mouse movements directly to an object e g a viewport
14. Elevates 60 degrees angle or de elevates 0 degrees angle the turret according to it s initial position x void HHRotation97 HHRotationTask void myRotation if HHRotation97 myRotation gt taskElevate HHRotation97 myRotation rotate 1 1 1 HHRotation97 myRotation gt currentAngle 1 if HHRotation97 myRotation gt currentAngle gt 60 HHRotation97 myRotation gt taskRunning FALSE delete HHRotation97 myRotation gt rotationTask else HHRotation97 myRotation rotate 1 1 1 HHRotation97 myRotation gt currentAngle 1 if HHRotation97 myRotation currentAngle lt 0 HHRotation97 myRotation gt taskRunning FALSE delete HHRotation97 myRotation gt rotationTask kok k k k k kok k oko k k kok k k kok k kok k k k k k kok k k kok kok kk k kok k k kok k k k k k k k k k kk k k kk k kk k k kk kk kkk kk k I PRIVATE METHODS REL S EE K k k kok k kok k ko kok kok kok k kok k kok k k k k k kk k kk k k kk k kk k kk k k kk k kk k kk k k kk k kk k kk kkk kk kkk kk kkk I ek Loads all geometry that is used in the instance One difference between using VRML 2 geometry and VRML 1 is that there is no need to rotate the geometry after loading a VRML 2 geometry x void HHRotation97 loadGeometry float trans 3 2 2 0 WtP3 turretTrans trans whole MovNodeLoad bamse666 wrl 1 f assy wrl rotate2 OT wrl whole SetName Who
15. HHBamse myRotation gt rightRun FALSE delete HHBamse myRotation gt rightTask HHBamse myRotation gt rightTask NULL else HHBamse myRotation gt rotate 1 1 2 HHBamse myRotation gt rightAngle 1 if HHBamse myRotation gt rightAngle lt 0 HHBamse myRotation gt rightRun FALSE if HHBamse myRotation elevateOther HHBamse myRotation elevateOther FALSE HHBamse myRotation gt turretElevation TRUE delete HHBamse myRotation gt rightTask HHBamse myRotation rightTask NULL The rotation task function for the HHBamse instance s radar pylon geometry Ef void HHBamse HHPoleTask void myRotation if HHBamse myRotation gt poleElevate HHBamse myRotation gt poleAngle 1 if HHBamse myRotation gt poleAngle lt 90 HHBamse myRotation rotate 1 float 90 HHBamse myRotation gt poleAngle 3 HHBamse myRotation gt headAngle 2 if HHBamse myRotation gt headAngle lt 180 HHBamse myRotation rotate 1 float 180 HHBamse myRotation gt headAngle 4 else HHBamse myRotation poleRun FALSE delete HHBamse myRotation poleTask HHBamse myRotation poleTask NULL else HHBamse myRotation poleAngle 1 if HHBamse myRotation gt poleAngle gt 0 HHBamse myRotation rotate 1 float 90 HHBamse myRotation gt poleAngle
16. Ke S EE K K k ko k k kok k oko k k kok k k k k k kok k k k k k kok k kok kok kok ko kok k k kok kok kok k k k k k kok k kok k kk k k kk k kk k kk k k kk I The rotations task function for the turret geometry This function rotates the specified HHRotation instance s turret geometry 360 degrees one degree each turn and then terminates the task MA void HHRotation HHRotationTask void myRotation HHRotation myRotation rotate 1 1 1 HHRotation myRotation gt currentAngle 1 if HHRotation myRotation gt currentAngle gt 360 HHRotation myRotation gt taskRunning FALSE delete HHRotation myRotation gt rotationTask BR HR KK IK kok k oko k KOKK KR k ko kok RR k ko kok kok kok k kok k k kok kok kk k kok k k kk kok kk k kk k k kk k kk k kk kk kk I PRIVATE METHODS PEN kok k kok k o oko k oko k oko kok kok k ko kok k k kok k kok kok kok kok kok k kok k k kok k kok Ck ko kk k kk k kok k kk k k kk k k kk k kk kk kk ko ke ke ek Loads all geometry used in the instance and makes sure that it s location and rotation is correct a VRML 1 0 geometry needs to be rotated 180 degrees due to different coordinate systems x void HHRotation loadGeometry float trans 3 f 2 2 Ok WtP3 turretTrans trans whole MovNodeLoad rotatel wrl 1 f whole gt SetName Whole turret MovNodeLoad rotate2 wrl 1 f turret gt SetName Turret WtMovable turr
17. SeparateNode whole DOF H RampH15 RTURRET if NULL theParent WtGroup theParent gt InsertChild right theLocation WtGroup theParent gt DeleteChild theLocationt1 rockOn TRUE separateNode whole H RorHU16 RTURRET if NULL theParent WtGroup theParent gt DeleteChild theLocation rockOn TRUE separateNode whole H RorHN17 RTURRET if NULL theParent WtGroup theParent gt DeleteChild theLocation right GetExtents rightExt WtMovable right gt GetTransform rightTrans Performs all calculations needed to convert the whole radar pylon to movable nodes 88 ae void HHBamse computePole aA void Search for pole pole new WtMovSep NULL pole SetName Pole rockOn TRUE separateNode whole o1719 POLE if NULL theParent WtGroup theParent gt InsertChild pole theLocation WtGroup theParent gt DeleteChild theLocation l rockOn TRUE separateNode whole 04136 POLE if NULL theParent WtGroup theParent gt DeleteChild theLocation Search for head head new WtMovSep NULL head gt SetName Head rockOn TRUE separateNode whole o1618 HEAD if NULL theParent pole gt AddChild head WtGroup theParent gt DeleteChild theLocation rockOn TRUE separateNode whole 04035 HEAD if NULL theParent WtGroup theParent g
18. This is most useful when a geometry is to be rotated around a specific point se paragraph 3 2 4 10 4 Results After an initial search on the software market primarily using the Internet six different development environments were considered to be of interest These were chosen because they are widely used when developing VR applications Four of these can be seen as SDKs with varying levels of abstraction see paragraph 3 2 1 as illustrated in Figure 4 1 The fifth environment is actually a markup language for creating interactive 3D worlds see section 4 5 below In addition to these five environments a somewhat different API that has no support of its own for 3D graphics also was considered to be of interest see section 4 6 Each of the requirements in section 3 2 will be graded according to the scale poor adequate or excellent The results of each SDK s evaluation will be presented in a table at the end of the evaluation Level of abstraction Figure 4 1 Different levels of abstraction 4 1 WorldToolKit WORLDTOOLKIT WTK is according to the developer Sense8 Corporation a cross platform development environment for high performance real time 3D graphics applications 2 WTK is a SDK that provides a developer with the tools to create virtual worlds through C or C code that calls WTK functions WTK is a library consisting of over 1 000 functions written in C that handle low level graphics and I O operation
19. as well as simple 3D applications that run on an ordinary PC Thus it is important to have some sort of support for the implementation of VR hardware and also the construction of necessary drivers if these are not included with the hardware 3 3 Concerning the testbed As mentioned earlier part of this project is to develop a simple testbed using the SDK that I have found most suitable for use at SAAB Bofors Dynamics The testbed is a prototype of a computerized manual consisting of a simple 3D model of BAMSE one of SAAB Bofors Dynamics products This model shall be interactive in the sense that the user can trigger some reactions in the model such as the animation of movable parts It shall be possible to extend the program so that a window containing a hypertext documentation could be linked with the model Using this structure a user can click on one part of the model and get information about that part in the hypertext window This prototype is also part of the evaluation and further tests of the functionality of the used SDK There are two subjects that require special attention 1 The connection to I DEAS must be thoroughly evaluated It may be possible that the SDK claims to have full support for a certain file format but in reality some aspects are missing 2 Given a certain point in the global coordinate system of I DEAS it is desirable to have some sort of method to find the same point in the coordinate system used by the SDK
20. float positive 1 5 PI 180 myGeometry gt rotate rot 0 f part Tells the HHBamse geometry to shoot a missile from the thatOne turret NA 62 void HHVirtualManual rockNroll int thatOne myGeometry gt shoot thatOne Activates and deactivates the demo mode Initiates the variable that are needed mostly counters for the demo task xy void HHVirtualManual demoMode if demoOn demoOn TRUE viewPortCount radarCount headCount 0 countUp radarUp headUp TRUE myGeometry nullAl11 FALSE resetViewport setManState BAMSE WHOLE if HHBamse myGeometry isLeft HHBamse myGeometry turretElevation TRUE currentTurret 1 demoTask new WtTask this HHVirtualManual HHDemoTask 1 f else demoOn FALSE C 3 Listener and screamer LLLLLALALALSLALLLLLLLLLASLLLLLAAALLAMLLMALALLALLLLALSLSALLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL HHListener h Listener interface T T T TT TTT TTT TTT ifndef HH LISTENER define HH LISTENER The interface that a class must implement to make it possible to use the HHListener HHScreamer system A message from a HHScreamer class is sent to the HHListener class which has registered itself as a listener at the screamer class as a void which one have to typecast to the information that should be read from Lbs P class HHListener public virtual void listen void data 0 3 fendif
21. gt 90 HHVirtualManual myApp headUp FALSE else temp gt rotate PI 180 0 f 6 temp rotate 1 f O f 5 else HHVirtualManual myApp headCount 60 if HHVirtualManual myApp gt headCount lt 90 HHVirtualManual myApp gt headUp TRUE else temp gt rotate PI 180 0 f 6 temp rotate 1 f 0 f 5 if 1 HHVirtualManual myApp currentTurret amp amp HHBamse temp gt turretElevation TRUE HHVirtualManual myApp currentTurret 1 else if 0 HHVirtualManual myApp gt currentTurret amp amp HHBamse temp gt turretElevation FALSE HHVirtualManual myApp currentTurret 3 else if temp shoot HHVirtualManual myApp currentTurret HHVirtualManual myApp gt currentTurret if 3 HHVirtualManual myApp gt currentTurret HHVirtualManual myApp gt currentTurret 0 else if 5 HHVirtualManual myApp currentTurret HHVirtualManual myApp gt currentTurret 1 if 400 gt HHVirtualManual myApp gt viewPortCount 100 lt HHVirtualManual myApp viewPortCount switch HHVirtualManual myApp currManState case BAMSE WHOLE HHVirtualManual myApp gt setManState BAMSE TURRET break case BAMSE TURRET HHVirtualManual myApp gt setManState BAMSE POLE break case BAMSE POLE HHVirtualManual myApp gt setManS
22. ven p en sekund hastighet av mer sedan sin nda till gr nsen Missilens antingen det direkttr ff ett av splitter och av flygande m l signals kande missiler och till transportplan Eldledningsradar win Draw2DText 0 01f 0 69f Styrda vapen Med en effektiv win Draw2DText 0 01f 0 67f upp till 15 km och en r ckvidd p win Draw2DText 0 01f 0 65f BAMSE systemet l mpligt inte win Draw2DText 0 01f 0 63f vitala milit ra objekt och r rliga win Draw2DText 0 01f 0 61f ocks f r skydd av infrastruktur win Draw2DText 0 01f 0 59f f r hela nationen I s dana fall da win Draw2DText 0 01f 0 57f avfyras fr n ett flygplan utanf r win Draw2DText 0 01f 0 55f luftf rsvarssystemets r ckvidd har BAMSE win Draw2DText 0 01f 0 53f f rm ga att bek mpa den attackerande win Draw2DText 0 01f 0 51f break case BAMSE TURRET win gt Draw2DText 0 01f 0 95f Robot 23 h ghastighetsmissil win Draw2DText 0 01f 0 94f Te CC E EC DE win Draw2DText 0 01f 0 91f har en snabb acceleration och win Draw2DText 0 01f 0 89f hastighet vilket resulterar i kort win Draw2DText 0 01f 0 87f l nga avst nd Inom kortare tid n win gt Draw2DText 0 01f 0 85f accelererar missilen upp till en win gt Draw2DText 0 01f 0 81f an 3000 km h och bibeh ller win gt Draw2DText 0 01f 0 79f hastighe
23. void HHBamse rotate int axis float radians Rotates the specified part of the geometry according to the transformation values read from the mouse S void HHBamse rotate const float amp transX const float amp transY int part switch part case 0 if missileRun WtMovable missile gt SetTransform missileTrans WtMovable motor gt SetTransform motorTrans WtMovable whole gt MovAxisRotation Y transY PI 180 break case 1 case 2 turretRotation transY PI 180 part break case 3 poleRotation transY PI 180 break 79 case 4 headRotation transY PI 180 break case 5 topRotation transX PI 180 break case 6 if poleElevate radarRotation transX break case 7 if poleElevate screenRotation transX break Controls if if the specified node path contains any of the instance s movable geometries If so a task is activated that rotates the geometry accordingly Ef void HHBamse chkNode WtNodePath nodePath extern HHVirtualManual application int currentNodeNum WtNode currentNode currentNodeNum nodePath NumNodes 1 char name while 0 lt currentNodeNum currentNode nodePath gt GetNode currentNodeNum if NULL currentNode name currentNode GetName if left currentNode NULL name amp amp 0 strcmp name left gt GetName application gt s
24. 3 HHBamse myRotation headAngle 2 if HHBamse myRotation headAngle gt 0 HHBamse myRotation rotate 1 float 180 HHBamse myRotation gt headAngle 4 else 83 HHBamse myRotation poleRun FALSE delete HHBamse myRotation gt poleTask HHBamse myRotation gt poleTask NULL The rotation task function for the HHBamse instance s radar head geometry EY void HHBamse HHRadarTask void myRotation if HHBamse myRotation gt radarAngle lt 0 HHBamse myRotation radarAngle 7 f PI 180 if HHBamse myRotation radarAngle gt 0 HHBamse myRotation gt radarAngle 0 else if HHBamse myRotation radarAngle gt 0 HHBamse myRotation radarAngle 7 f PI 180 if HHBamse myRotation gt radarAngle lt 0 HHBamse myRotation radarAngle 0 HHBamse myRotation radarRotation 0 f Just to update the screen if 0 HHBamse myRotation radarAngle delete HHBamse myRotation gt radarTask HHBamse myRotation gt radarTask NULL The rotation task function for the HHBamse instance s radar disc geometry ak void HHBamse HHScreenTask void myRotation HHBamse myRotation gt screenAngle PI 180 if HHBamse myRotation gt screenAngle lt 0 HHBamse myRotation gt screenAngle 0 HHBamse myRotation gt screenRotation 0 f Just to update the screen if 0 HHBamse myRo
25. Conclusion 4 2 1 Level of abstraction 4 2 2 Connection to I DEAS 4 2 3 Hierarchical transformation 4 2 4 Rotation in any chosen point 4 2 5 Different levels of immersion 4 2 6 Conclusion vi 4 3 Cosmo 3D and OpenGL OpBRIZCE ooo Sot ssneannss b l dab ea ee eae 18 4 3 1 Level of abstraction 4 3 2 Connection to I DEAS 4 3 3 Hierarchical transformation 4 3 4 Rotation in any chosen point 4 3 5 Different levels of immersion 4 3 6 Conclusion d GALA ooo E E ooo SA o ba LU ot Ra IO B eoe etus 21 4 4 1 Level of abstraction 4 4 2 Connection to I DEAS 4 4 3 Hierarchical transformation 4 4 4 Rotation in any chosen point 4 4 5 Different levels of immersion 4 4 6 Conclusion 4d MRM OR ST dad ene ik Rede eeu aae mo ee 25 4 5 1 External Authoring Interface 4 5 2 Cortona SDK 4 5 3 Cosmo Worlds 4 5 4 Level of abstraction 4 5 5 Connection to I DEAS 4 5 6 Hierarchical transformation 4 5 7 Rotation in any chosen point 4 5 8 Different levels of immersion 4 5 9 Conclusion 4 07 MRoIuSSIeI edu estesa ndkiian NTA SNS RSA deka coo d 28 4 7 Other development environments skus ceo ue one deena jens 30 5 Testbed created with World ToolKit 0000000000000000ooooooeoooosososososososososososososososossssssse OD Dale IDO SCE LOM o dostesscop DA Oo UR nan Ue Metab stade za chou atak RR 32 5 2 Design and StruC Te osie nsiro ore aeee E A L aE E ENKET 34 5 37 VEXBCUHOER o an dte alfo te e utet e aA aata e e a i ess 39 5 4 Connection betwe
26. Virtual Technologies CyberGloves Immersion boxes CAVE C2 a CAVE like device HMDs and ordinary screens VR JUGGLER is currently available on the SGI HP and Windows NT platforms but since it is written using standard C it is an easy task to port VR JUGGLER to new platforms 11 Network Manager Input Manager Figure 4 5 VR Juggler s structure Environment Manager Application Display Manager Output Manager Manager Graphics API Figure 4 5 illustrates the structure of VR JUGGLER As shown in the figure VR JUGGLER consists of objects called managers Each manager handles a different aspect or part of the system and encapsulates all functionality and system specific details of that part An application has to communicate with a given part through that part s manager The kernel is 29 the glue that binds all the managers and the application together and also handles all the communication within the system 4 All of these managers will not be described in more detail their names tell in what area they operate This section will concentrate on the major difference between VR JUGGLER and all of the other SDKs that is mentioned in this report namely the draw manager As illustrated in Figure 4 5 above the draw manager uses an external graphics and windowing API i e VR JUGGLER has no support of its own for graphics Instead this part of the system has
27. WTFRAME LOCAL WtMovable screen gt SetTransform s Rotates the radar disc the given angle void HHBamse screenRotation float angle WtP3 translation if screenAngle angle lt 0 angle screenAngle else if screenAngle angle gt PI 2 angle PI 2 screenAngle screenAngle angle WtMovable screen gt SetTransform screenTrans translation 0 fs translation 1 translation 2 WtMovable screen ll ou ef Ne Se hho gt Translate translation WTFRAME LOCAL WtMovable screen gt MovAxisRotation Z screenAngle translation 0 1 translation 1 1 WtMovable screen gt Translate translation WTFRAME LOCAL Separates the movable parts of the geometry from the other geometry and converts them to movable nodes Sy void HHBamse separateNode WtNode currentNode char nodeName HHParts whichPart if rockOn char name currentNode gt GetName if NULL name amp amp 0 strcmp name nodeName theParent currentNode gt GetParent 0 name theParent gt GetName if NULL theParent WTmessage Unable to trace node n else int childNum WtGroup theParent NumChildren for theLocation 0 theLocation lt childNum theLocation if WtGroup theParent GetChild theLocation break Switch whichPart case LTURRET left gt AddChild currentNode br
28. and activates events considering this and tells the application to update the mouse handler xy void HHVirtualManual HHActionFn extern HHVirtualManual application short key WtKeyboard GetLastKey switch key case 27 case Q case g WtUniverse Stop break case C case c if application gt demoOn application gt completeScene break case Z case z if application gt demoOn application gt myGeometry gt nullAl1 TRUE application gt resetViewport break case H case h application setManState BAMSE IDLE break case S case s if application gt demoOn application gt setSpecMode break case F case f WTmessage Current framerate f n WtUniverse FrameRate break case 1003 if application demoOn application radar 6 1 break case 1002 if application gt demoOn application radar 6 1 break case 1000 if application gt demoOn application radar 7 1 break case 1001 if application gt demoOn application radar 7 1 break case 1 case 2 case 3 case 4 if application gt demoOn application gt rockNroll int key 48 break case application gt demoMode break default WImessage d n key application gt updateMHandler application gt myWindow gt SetFgActions HHVirtualManual HHFgDrawFn A function that displays an imag
29. any specification but rather developed during discussion about what could be demanded of a 3D application development software From now on the evaluated software is referred to as a SDK for simplicity 32 1 Level of abstraction This is a general requirement It should be fairly easy to develop software with the SDK otherwise its use would be worthless A system developer should not have to be concerned with the lower aspects of the program By letting the SDK handle the lower render specific details a developer can concentrate on creating usable applications There is a choice to be made whether one should use a highly abstract SDK which provides the desired results fast or use a less abstract one which perhaps is more flexible It is necessary to weight these two aspects against each other and see what is best suited for the given project 32 2 Connection to I DEAS The second requirement is also a very important one All the geometries that will be used by the programs developed with the SDK are made by the CAD system I DEAS Therefore it must be possible to import geometries created in I DEAS to the chosen SDK Preferably this should be done directly 1 e the SDK can read the I DEAS file data but this is not necessary It is enough that some connection exists for example through converting the I DEAS data to some format recognized by the SDK Yet in case of a conversion it is necessary that the procedure is as simple and accu
30. created with WorldToolKit A part of this project was the creation of a testbed This chapter describes the design and implementation of the program that was written using WorldToolKit Recommendations A discussion concerning the results of the evaluations as well as the author s opinions and recommendations regarding the different development environments Please note that chapters 1 1 and 1 2 are written together with Anders Aslund in conjunction with his Bachelor s project Special Effects in OpenGL 2 Background and goals This chapter describes the background of this project the problems that are supposed to be solved SAAB Bofors Dynamics current situation and their need for this type of project 2 1 Background During 1999 SAAB Bofors Dynamics began to look at the area of real time simulation and environment animation The idea of using VR to help SAAB Bofors Dynamics develop educate market and maintain their products stemmed from that project In today s product development there are a plentitude of advanced software that makes the work easier for engineers and assemblers Computer Aided Engineering CAE has come a long way and in many areas of engineering today there is software that supports different stages of the product development SAAB Bofors Dynamics uses a CAD system called I DEAS which supports a diversity of usable functions related to 3D product design However a valuable function is lacking namely
31. development Another positive aspect is the high performance that VTREE provides On the negative side it seems that there is no simple connection between VTREE and I DEAS i e it is necessary to convert the I DEAS data in several steps to finally reach the VTREE file format Otherwise VTREE is quite pleasant to work with and it has several features that have proven to be very useful Level of abstraction Excellent Connection to I DEAS Poor Hierarchical transformation Excellent Rotation in any chosen point Excellent Different levels of immersion Adequate Table 4 3 VTree conclusion 4 3 Cosmo 3D and OpenGL Optimizer COSMO 3D is a freely distributed scene graph API developed by Silicon Graphics Inc SGI It is based on SGI s graphics API OPENGL which is more or less industry standard and provides a developer with a high level interface for complex 3D graphics applications COSMO 18 3D is written in C and is designed in an object oriented manner thus providing a developer with full access to inheritance polymorphism and other object oriented strengths 6 The COSMO 3D API has a slightly lower level of abstraction than WTK and VTREE as shown in Figure 4 1 This means that there is a bit more coding involved in the creation of an application but at the same time the developer has more control There is always a choice to be made between flexibility COSMO 3D and abstraction WTK Since COSMO 3D is wri
32. eaa ran ce eR 67 CL The Bamse geometry ass uivcedietvesee etus debutu Pede tentus ode tute fi rotes T11 viii List of Figures Figure 1 1 An example 3D coordinate SYStelM sssssesserserssrrssrsrrrsrrssrssrssrssrrssrsrrs rr serna 2 Figure 1 2 A simple scene erapli oae a asa oie Deinde n ko upe eee 3 Figure 4 1 Different levels of abstraction eee eee addis nee tg dence dedica 11 Figure 4 2 Comparison of VRML 1 0 and 2 0 eee eee een 14 Figure 4 3 Rotation in a specific POInt sccsscesssccsssercecssncsesenssensceseneceecnasescnanesenneess 15 Figure 4 4 The RXscene environment esee eene enne entente nenne enne 24 Figure 4 5 VR Juggler s structure ons eo Prts ene iu ed aetas eo tates Pens coe Ita be aate Faces ora 29 Fig te 5 1 A Bamse Unt ete dise pet a quid 32 Figure 5 2 A Bamse unit shown in different situations esee 33 Figure 5 3 The design of the testbed ee eniro tee a eed eens heme 34 Figure 5 4 The detailed design of the input handling sss 35 Figure 5 5 The detailed design of the geometry handling ssss 36 Figure 5 6 The detailed design of the Bamse geometry class sess 38 Figure 5 7 Recommended design of the geometry classes esses 39 Figure 5 8 The WTK program loop iie tonii ete since sitae ee pecia cci itte i Redde
33. h gt include HHGeometry h HHRotation97 is basically th same as HHRotation2 but it uses VRML 2 0 geometry instead 73 of VRML 1 0 Another difference is that it does not work since WTK is unable to handle VRML 2 0 y class HHRotation97 public HHGeometry public HHRotation97 HHRotation97 FLAG addAsChild WtGroup parent void rotate int axis float radians PI 180 void rotate const float amp transX const float amp transY int part void chkNode WtNodePath nodePath WtP3 getMidpoint Static void HHRotationTask void myRotation private void loadGeometry void destroyGeometry void turretRotation float angle void locateTurret WtNode currentNode Geometry variables WtNode whole turret The geometries WtP3 extents The extent of the turret geometry FLAG rockOn Is used to recursively search after a geometry Task variables FLAG taskRunning Is a task currently active int currentAngle The current angle is a task is running WtTask rotationTask The actual task FLAG taskElevate Should the turret be elevated or de elevated 3 fendif TERES EE ALATA TL ATALA STAAL AAT AA D SEIS PESE L AAAA A S SEES ESSE AAAA SS SES HHRotation97 cpp The test geometry adapted for VRML 2 0 VRML 97 Le T T TETU include HHRotation97 h BR K K k oko kok k oko k k oko kok KR KORK ko kok kok kok k kok k k kok kok kok k kok k
34. inside a 3D scene The whole idea is that by placing the user in the simulation loop i e increasing the level of immersion he can apply his inherent spatial skills to work with the complex data that the visualization presents Thus the aim is to create a sense of presence by letting the user s sensory inputs receive data generated by a computer rather than from the physical world 1 Today this is accomplished by replacing hearing and vision but tomorrow s technology might offer replacements for other than these two senses 1 3 1 Head Mounted Displays The replacement of hearing is nothing new and is simply accomplished by using headphones connected to a computer Replacing vision is a bit trickier since depth perception comes from the difference between the two images that the eyes capture In order to trick the mind that it is really in a virtual environment stereographic viewing is used Stereographic viewing means that the computer generates two images of the viewed scene where one appears to be seen from a view slightly to the right of the other The first image is then presented to the left eye and the second to the right This emulates depth perception and the user think that he sees in 3D The device that is used to accomplish this is called a Head Mounted Display HMD and generally looks like a set of glasses or even a helmet that are placed on the user s head A simpler version of the HMD is stereo glasses or shutte
35. k kok kok kk k kk k k kk k k kk k kk k k kk k kk k kk kk k kk dk PUBLIC METHODS KK SE E K K k kok k Ck kk ko KOKK oko kok kok kok ko kok kok kok k kok k k kok kok kok k kok k k kok k kok k kk k k kk k k kk k kk k k kk k kk k kk k k kkk The default constructor Creates a new HHRotation97 instance and loads it s geometry HA HHRotation97 HHRotation97 loadGeometry taskRunning FALSE taskElevate FALSE The destructor De allocates the memory used by the instance s HHRotation97 HHRotation97 destroyGeometry Adds the HHRotation97 geometry as the last child of the specified group node parent The return value is the result of the operation TRUE FALSE i FLAG HHRotation97 addAsChild WtGroup parent return parent AddChild whole 74 Rotates the specified part of the geometry around the given axis X Y Z The angle radians should of course be in radians NOT IMPLEMENTED void HHRotation97 rotate int axis float radians Rotates the specified part of the geometry according to the transformation values that have been read from the mouse Ef void HHRotation97 rotate const float amp transX const float amp transY int part switch part case 0 WtMovable whole gt MovAxisRotation X transX PI 180 WtMovable whole gt MovAxisRotation Y transY PI 180 break case 1 turretRotation transY PI 180 break
36. kk k kk k k kk kk k k k kk kkk kk kkk k STATIC METHODS S EEK KR kok o k k k k kok KOKK k ko kok k k kok k kok k k kok k k kk k kok k k kok k k k k k k k k k kk k k kk k kk k k kk k kk k kk kk k I I A The rotation task function for the HHBamse instance s left turret geometry void HHBamse HHLeftTask void myRotation if HHBamse myRotation gt leftElevate else HHBamse myRotation rotate 1 1 1 HHBamse myRotation leftAngle 1 HHBamse myRotation gt leftAngle gt 60 IE HHBamse myRotation leftRun FALSE delete HHBamse myRotation leftTask HHBamse myRotation leftTask NULL HHBamse myRotation rotate 1 1 1 HHBamse myRotation gt leftAngle 1 HHBamse myRotation gt leftAngle lt 0 if HHBamse myRotation gt leftRun FALSE if HHBamse myRotation elevateOther HHBamse myRotation elevateOther FALSE HHBamse myRotation gt turretElevation FALSE 82 delete HHBamse myRotation gt leftTask HHBamse myRotation gt leftTask NULL The rotation task function for the HHBamse instance s right turret geometry ay void HHBamse HHRightTask void myRotation if HHBamse myRotation gt rightElevate HHBamse myRotation gt rotate 1 1 2 HHBamse myRotation gt rightAngle 1 if HHBamse myRotation gt rightAngle gt 60
37. or a geometry in a WTK application This inherent mouse handling can be configured in two different ways where the mouse movements are translated to different actions in the application None of these configurations work in a way that is suitable for this type of application Therefore it was necessary to write a new mouse handling system i e the class HHMouseHandler The detailed design of the input handling is illustrated in Figure 5 4 34 fo Ern u gg HHListener gt f eosin S Histen Ss etListener AY oae RS ee a MX p b CU N EN N HHVirtualManual mykistener run E i s etManState X setSpecModel HHActionFn HHDrawFn Mean n HHFgDrawFn HHM ouseHandler HHDemoTask myMHandler exam ineMouse lt gPdisplay Splash PupdateMHandler n gPresetViewpont amp f rotateViewport amp frzoomV iewport amp completeScene amp f rockNfoll 7 adem ia gPradar v Figure 5 4 The detailed design of the input handling The class HHVirtualManual is the central class in the structure best illustrated in Figure 5 3 This class contains the actual application as well as instances of the other classes used in the design One of the instances is a HHMouseHandler which as mentioned earlier is the class that handles all input from the mouse The handling of the keyboard events is encapsulated in HHVirtualManual Tog
38. same vendor as other systems already in use VTREE is already used in other developments while SAAB Bofors Dynamics has no previous experience with COSMO3D OPENGL OPTIMIZER VR JUGGLER 45 References 1 2 3 4 10 11 Michael Louka An Introduction to Virtual Reality stfold College 3 revision 1998 http w1 2691 telia com u269100246 vr vrhiof98 Engineering Animation Inc WorldToolKit Reference Manual Release 9 1999 Sense8 Corporation WorldToolKit Release 8 Technical Overview Release 8 1998 Allen Bierbaum and Christopher Just Software Tools for Virtual Reality Application Development Iowa Center for Emerging Manufacturing Technology Iowa State University 1998 CG Inc VTree User s Manual 5 edition 1999 George Eckel Cosmo 3D Programmer s Guide Silicon Graphics Inc 1998 Realax Software Realax Reference Manual 1999 Rikk Carey and Gavin Bell The Annotated VRML 2 0 Reference Manual Addison Wesley Developers Press 1997 Daniel K Schneider and Sylvere Martin Michiellot VRML Primer and Tutorial TECFA Faculte de Psychologie et des sciences de education University of Geneva Draft version 1 1a 1998 Attp tecfa unige ch guides vrml vrmlman vrmlman html ParallelGraphics Cortona Software Developers Kit Documentation 1999 Christopher Just Allen Bierbaum Albert Baker and Carolina Cruz Neira VR Juggler A Framework for Virtual Reality Development Iowa Center for
39. systemansvaret Serieproduktion win gt Draw2DText p borjas vid sekelskiftet win gt Draw2DTex allv derskapacitet och en r ckvidd win gt Draw2DText maximala standoff avst ndet f r 57 text information win gt Draw2DText 0 01f t 0 win gt Draw2DText 0 01f t 0 t 0 t 0 t 0 E 0 E 0 E 0 t 0 01 E 0 t 0 t 0 01 t 0 t 0 ECO t 0 t 0 t 0 on top of the 3D scene 0 95f O1f CREATED USING WORLDTOOLKIT FROM SENSE8 Valkommen till BAMSE 0 94f VOTE 0 89f 0 87 0 85f 0 83f 0 79 0 77 Mus x Vanster V nster dbl Mitten H ger Tangentbord 5 1 4 Avfyra pilar Rotera radar f 0 95f f 0 73 0 71 0 69 0 67 0 65 0 63 space Demo x z Nollst ll C Anpassa i h Visa i s Visa a Ese Bofors RBS 23 BAMSE 0 94f 0 91f 0 89f 0 87f 0 85f 0 81f 0 79 0 77 0 73 0 71 Ar 1993 best llde fullskalig 23 BAMSE BAMSE samarbetsprojekt Ericsson Microwave det vergripande kommer att BAMSE har som verstiger det elektro optiskt h jdt ckning pa mer nl5 km r bara f r skydd av marktrupper utan av vital betydelse en standoff missil fortfarande missilen BAMSE missilen d rav f ljande h g flygtid
40. the ability to control the assembly of products Questions such as Are there room for the assembler s hands and Is it possible to assemble in the correct order need to be answered I DEAS only offers the functionality to check if individual parts fit together Hopefully VR can help answer the other questions Today s documentation of a product consists of quite a number of folders full of printed papers A computerized equivalence to this documentation is of use for both marketing and documentation purposes 2 2 Goals The purpose of this project is threefold 1 To examine in which areas SAAB Bofors Dynamics need VR systems 2 To examine and evaluate different software Software Development Kits SDKs and Application Programming Interfaces APIs and draw a conclusion of what software environment that will be of most use in the development of these VR systems 3 To examine the VR hardware market and formulate a requirements specification for the hardware that will be incorporated in these VR systems As a part of the Bachelor s project a small testbed shall be created This will act as an example of how a computerized manual can be structured This manual will include a simple interactive 3 dimensional model of some product and it should be possible to link the model together with a manual in a hypertext form 3 Method and requirements These conditions and reguirements are a combination of the reguirements and
41. 0 translation 1 leftExt 1 translation 2 0 WtMovable left gt Translate translation WTFRAME LOCAL WtMovable left gt MovAxisRotation Z angle translation 0 1 translation 1 1 WtMovable left gt Translate translation WTFRAME LOCAL else if 2 part translation 0 rightExt 0 translation 1 rightExt 1 translation 2 0 WtMovable right gt Translate translation WTFRAME LOCAL WtMovable right gt MovAxisRotation Z angle translation 0 1 translation 1 1 WtMovable right Translate translation WTFRAME LOCAL Rotates the radar pylon geometry the specified angle x void HHBamse poleRotation float angle WtM4 r s WtP3 translation WtMovable radar gt GetTransform r WtMovable screen gt GetTransform s WtMovable pole gt SetTransform poleTrans WtMovable head gt SetTransform headTrans WtMovable radar gt SetTransform radarTrans WtMovable screen gt SetTransform screenTrans translation 0 8 f translation 1 poleExt 1 translation 2 0 WEtMovable pole Translate translation WTFRAME LOCAL WtMovable pole gt MovAxisRotation Z angle translation 0 1 translation 1 1 WtMovable pole gt Translate translation WTFRAME LOCAL WtMovable radar gt SetTransform r WtMovable screen gt SetTransfor
42. 40 Figure 5 9 WTK s coordinate system cerei ee edn pre huie sr sr Red 42 1X List of tables Tablesk1 WEK import POEBIdUS oon orate terc lnscn ei oett IE Ibn Ea ai 13 Table d 2 2 WEK eoncl siQH aoo deuote oiu tae ae E aie aca eee tub tu au de diua 16 Table 43 V Tree Conclusions iu oen neve eds iie ease es 18 Table 4 4 Cosmo 3D and OpenGL Optimizer import formats ee 19 Table 4 5 Cosmo 3D and OpenGL Optimizer conclusion eee 21 Table 4 6 Realax import export formats sssmmssrrsssrrssrrrerrresrrrrsrresrrrsrrrerrrr sens rr nennen nennen 23 F ble4 7 Realax conclusions herrita sond ace tu t d Boz litte ooo 25 Table4 8 VRML conclusion eure qoe nece ted ge eti argued 28 Table 4 9 VR Jugeler conclusion sio ned ciao t pU edat tad 30 Table A 1 Head Mounted Display Sky omoi eee Pe o eR II e Mi AM Museo meu 48 Table 2a CHDVES Loose uei rdiet uu c oka hue sv RE 49 EL 37 Frack ts Se En 49 1 Introduction This is both a general introduction to the areas covered in this project and a brief introduction to the disposition of the thesis 1 1 Simulation visualization Simulation can be described in two ways either as an accurate numeric calculation of how something behaves under certain conditions or as a real time interactive visualization of a scenario based on some realistic approximations Basically this means that it is impossible to use accurate calculations and behavior mo
43. AB Bofors Dynamics is currently looking for and since the CAVE LIBRARY is only available on SGI platforms it is of little interest to this project LIGHTNING is an object oriented VR development environment LIGHTNING differs from the other environments discussed above since it supports multiple programming languages different parts of a system can be written with different languages for example C or Scheme LIGHTNING is unfortunately only available for SGI computers 31 5 Testbed created with WorldToolKit A part of the Bachelor s project was to create a testbed of a simple computerized manual using one of the evaluated SDKs This testbed serves both as an example of how such an application could be designed and as a further evaluation of the chosen SDK WTK has been chosen because it is a likely candidate and it has not been used earlier at SAAB Bofors Dynamics unlike VTREE The product that is to be used in the manual is BAMSE which is an anti aircraft defence system that SAAB Bofors Dynamics develops For more information about BAMSE please visit SAAB Bofors Dynamics homepage at hitp www saab se missiles 5 1 Description The testbed that has been created using WTK is more of a 3D demonstration of a BAMSE unit than a computerized manual see Figure 5 1 and Figure 5 2 The application presents an interactive 3D model of a BAMSE unit A user can left click on different parts of the model with the mouse to get information a
44. ALLALLALLLLSLLLLLLLSLLLLLLLLLLLLLLLSLLLLLLLLLLLLLLLLLLLILLLLLLL HHVirtualManual h The application T T TT T T TETU ifndef HH VIRTUAL MANUAL H define HH VIRTUAL MANUAL H include lt math h gt 52 include wt h include wtcpp h include HHBamse h Include one of these depending on what geometry include HHRotation h that should be used include HHRotation2 h include HHRotation97 h include HHListener h include HHMouseHandler h Constants kk ke e x e x x define LIGHTS FILENAME lights Filename for the light data define BG RED 150 Background color for the window define BG GREEN 150 define BG BLUE 210 define WIN XPOS 0 Position and size for the window define WIN YPOS O0 define WIN WIDTH 800 define WIN HEIGHT 600 Enumerations enum HHManualState BAMSE IDLE BAMSE WHOLE BAMSE TURRET BAMSE POLE BAMSE SPEC The actual application which includes all necessary functions WTK unfortunately needs some thing done in C style and methods for the program loop and the interactivity The class implements the HHListener interface which is necessary for effective communication with the mouse handler HHMouseHandler Kf class HHVirtualManual public HHListener public HHVirtualManual HHVirtualManual int run bool displayTree false void listen void data void setManState HHManualState newState void setSpecMode
45. Bamse myRotation mTranslation 0 15 f WtMovable temp SetTranslation HHBamse myRotation mTranslation HHBamse myRotation mTranslation 0 45 f WtMovable temp SetTranslation HHBamse myRotation mTranslation temp HHBamse myRotation motor HHBamse myRotation missileCount HHBamse myRotation motorAngle PI 30 f WtMovable temp MovAxisRotation Z2 HHBamse myRotation motorAngle HHBamse myRotation moTranslation 0 45 f 0 9f 25 HHBamse myRotation missileCount HHBamse myRotation moTranslation 1 27 0f 1 5f HHBamse myRotation missileCount HHBamse myRotation moTranslation 2 0 f WtMovable temp SetTranslation HHBamse myRotation moTranslation if HHBamse myRotation mTranslation 0 lt 200 HHBamse myRotation gt missileSeparated TRUE if HHBamse myRotation mTranslation 0 lt 2650 HHBamse myRotation gt missile gt Remove HHBamse myRotation missileRun FALSE delete HHBamse myRotation gt missileTask HHBamse myRotation gt missileTask NULL 91
46. E else Time to elevate currentAngle 0 taskElevate TRUE taskRunning TRUE rotationTask new WtTask this HHRotation2 HHRotationTask break currentNodeNum 71 iy f Returns the midpoint of the geometry Kv WtP3 HHRotation2 getMidpoint WtP3 midpoint WtGroup whole gt GetMidpoint midpoint return midpoint RH k oko kok k oko RR k kok k A kok ko kok kok kok kok k k kok kok kok k kok k k kok A kk k k kk k kk k kk I I STATIC METHODS Ke BR HK ko kok kok k oko k oko kok kok kok k kok k k kok k I kok kk k kok k k kk k kok k kok k k kk k k kk k kk k kk k kk k kk kk k kk I the rotation task function that rotates HHRotation2 s turret geometry If the turret geometry is already elevated it de elevates it 0 degrees otherwise it elevates the turret geometry 60 degrees xy void HHRotation2 HHRotationTask void myRotation if HHRotation2 myRotation gt taskElevate HHRotation2 myRotation rotate 1 1 1 HHRotation2 myRotation gt currentAngle 1 if HHRotation2 myRotation gt currentAngle gt 60 HHRotation2 myRotation gt taskRunning FALSE delete HHRotation2 myRotation gt rotationTask else HHRotation2 myRotation gt rotate 1 1 1 HHRotation2 myRotation gt currentAngle 1 if HHRotation2 myRotation gt currentAngle lt 0 HHRotation2 myRotation gt taskRunning FALSE d
47. E is a high level VR development environment available on several platforms including Windows NT and Sun Microsystems DVISE is primarily used to create virtual representations of products As such it emphasizes the import of CAD data for the creation of such applications Due to its specialization on virtual prototyping DVISE is not well suited for other tasks While it can be excellent in the development of a virtual manual it can complicate the development of other applications Even though it is not in the scope of this project to examine and evaluate DVISE it should still be considered as a possible development environment for SAAB Bofors Dynamics ALICE is a freely available prototyping system running on Windows platforms ALICE is designed to be easily used by non technical users Applications can be written using Python which is an interpreted object oriented scripting language Unfortunately ALICE is not a good candidate for SAAB Bofors Dynamics VR developments due to some limitations regarding large and very complex geometries AVOCADO is a VR software system running only on SGI platforms Thus making it impossible for SAAB Bofors Dynamics to use it as a development environment AVOCADO is designed for rapid prototyping of applications and utilizes Scheme as a scripting language The CAVE LIBRARY provides a fairly low level API for creating VR applications for projection based system e g the CAVE This is not an environment that SA
48. ENGL which makes it very easy to code pure OPENGL in a COSMO 3D structure In conclusion COSMO3D and OPENGL OPTIMIZER in combination with VR JUGGLER should be considered as a development environment to be reckoned with because of their flexibility and availability Level of abstraction Excellent Connection to I DEAS Adeguate Hierarchical transformation Excellent Rotation in any chosen point Excellent Different levels of immersion Poor Table 4 5 Cosmo 3D and OpenGL Optimizer conclusion 4 4 Realax According to the REALAX manual REALAX is a high performance virtual reality system running on all Silicon Graphics and Windows NT workstations 7 REALAX is a modeling as well as a real time visualization environment This means that programming is not needed in the development of an application although it could be done REALAX is divided in two different parts RXscene and RXrealtime RXscene is used for modeling and scene editing It is possible to use RXscene as a stand alone application to create 3D models or in combination with RXrealtime discussed below to provide a whole development environment The mouse in combination with the keyboard is used to create the models Various tools and gizmos usually called wizards in other Windows applications help the user in the creation process This part of the system is not that useful for SAAB Bofors Dynamics since the geometry already is created in I DEA
49. Emerging Manufacturing Technology Iowa State University 1998 46 A Future features implementing Virtual Reality hardware The computer market has always been turbulent and the VR market is no exception Vendors and products that are popular today might be gone tomorrow Because of this we have chosen only to include vendors with a good reputation in the following product overview We have also chosen only to include prices that we are certain are up to date thus we only include prices that have been given to us directly from the vendor or an distributor There are three types of hardware included that are of interest to SAAB Bofors Dynamics These are HMDs gloves and trackers all of these are introduced in chapter 1 3 There are a plentitude of other devices available on the VR market but judging from the preliminar guidelines we have been given from SAAB Bofors Dynamics these three types are all that is needed 47 A 1 Head Mounted Displays Vendor irtual Research teractive Imaging O Display Systems ricsson SAAB Avionics AB irtual Vision Inc aiser Electro Optics tereoGraphics Table A 1 Head Mounted Displays Products VFX3D T glasses LC I glasses glasses X2 L glasses ProTec HOPROS AddVisor 100 V Cap 1000 leGlass HiDef 60 HiDef 90 ProView 30 ProView 40ST ProView 50ST ProView 60 ProView 80 ProView XL35 ProView XL50 CrystalEyes CrystalEyes Wired
50. LER has been developed at the Iowa Center for Emerging Manufacturing Technology ICEMT Iowa State University since the beginning of 1997 The goal of VR JUGGLER is to aid a developer in the creation of VR applications so that the developer does not have to worry about the low level details of VR 11 One important 28 thing to mention at this point is that VR JUGGLER is still under development and is not a finished product VR JUGGLER functions as a middleware between an application and the complex interworkings of distributed computing shared memory multiprocessing and device I O 11 An example of this is the device handling where different devices with similar functionality can be programmed using the same function calls Data received from the devices will also have the same format In comparison WTK which also supports a plentitude of I O devices requires that a developer write different code for each type of device VR JUGGLER also offers run time flexibility This means that it is possible to reconfigure the whole system without stopping a running application An application created using VR JUGGLER is never aware of the lower levels of the system and thus never notices any changes such as a restart of a tracker or a switch from a HMD toa CAVE 11 VR JUGGLER supports the following input and output devices Ascension Technologies Flock of Birds Logitech s 3D Mouse Fakespace s BOOM Fakespace s PINCH gloves
51. OSMO 3D and OPENGL OPTIMIZER combined are able to load the following formats Cosmo 3D csb Open Inventor iv TRIS Performer pfb VRML wrl Table 4 4 Cosmo 3D and OpenGL Optimizer import formats 19 In addition to the formats in Table 4 3 OPENGL OPTIMIZER provides the developer with tools to write new loaders in order to extend the file format support Again VRML is the format of most interest and COSMO 3D has support for both VRML 1 0 and VRML 2 0 COSMO 3D has the exact same node representation and scene graph structure as VRML 2 0 which enables COSMO 3D to have full VRML support 4 3 3 Hierarchical transformation As most 3D systems COSMO 3D uses a hierarchical representation of 3D geometries thus allowing for hierarchical transformation see paragraph 3 2 3 4 3 4 Rotation in any chosen point In the evaluation of WTK a method for rotation is described paragraph 4 1 4 which is also applicable to COSMO 3D 4 3 5 Different levels of immersion Neither COSMO 3D nor OPENGL OPTIMIZER has any inherent support of immersion altering devices They are only APIs for creating high quality 3D applications such as CAD systems and as such there is no need for VR hardware support There is one remedy to this situation which is described in chapter 4 6 namely VR JUGGLER As described earlier VR JUGGLER has no inherent support for 3D graphics and has to utilize an external API for this COSMO3D is almost perfect for this p
52. REALAX has loaded the geometry the only primitives that are displayed are the cylinder and the box Judging from the result it seems that REALAX ignores the hierarchical data in the geometry file and only imports the geometry at the top of the scene graph the two cones were children of the box REALAX also ignores the transformations that should have been made to the box Moreover some of the surfaces of the geometries were missing The imported geometry did not look anything like the one that was stored in the file compare Figure 4 4 to Figure 4 3 This is simply not acceptable especially given that these geometries are very basic and not even remotely as complex as the geometries that will be used when SAAB Bofors Dynamics develops their applications 23 tLefts foloct x zhenipulnteg view Ctrl ds Fig iHinghtszHunu stel Figure 4 4 The RXscene environment 4 4 3 Hierarchical transformation Even though it seems like REALAX is unable to import hierarchical VRML 1 0 data it uses a hierarchical tree structure to represent a scene meaning that it supports hierarchical transformation as described in paragraph 3 2 3 4 4 4 Rotation in any chosen point The method described for rotation described in the chapter about WTK paragraph 4 1 4 is applicable to REALAX as well 4 4 5 Different levels of immersion REALAX user manual states that REALAX supports the output on all head mounted displays HMDs stereo systems a
53. S RXrealtime is a real time environment that allows the user to view a given scene 7 To navigate through the scene an ordinary mouse can be used but it is also possible to use more specialized input devices such as a VR glove RXrealtime is primarily made to view worlds 21 which means that the user flies around in the scene This is not so useful in creating smaller applications for example a computerized manual where it is only required to view a single object not a whole world All functionality in an ordinary programming SDK is also available in RXrealtime through a convenient graphical user interface GUI It is also possible to extend the basic functionality through the use of RXapi RXapi is a part of RXrealtime that allows a developer to include ANSI C programs in the RXrealtime environment RXapi is used as an ordinary API when writing these RXrealtime programs i e consists of a library file that is statically linked with the written code 4 4 1 Level of abstraction REALAX is actually the SDK with the highest level of abstraction among those being evaluated since a developer is able to use a GUI This is not necessary an advantage in fact it can be a disadvantage but the existence of RXapi improves the situation a bit Programming makes it possible to completely control a 3D scene but when it is necessary to create some 3D application fast and easy the RXrealtime environment could be quite useful The RXapi only allo
54. Siktlinjestyrning funktion splitter och anslagsr r och transportplan transporthelikoptrar Kryssnrb Ssarb laserstyrda bomber BEER eldledning sj6 och land NBC operat rer Ericsson Eagle m lf ljningsradar BAMSE SPEC win gt Set2DColor 39 win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DText win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DText win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex win gt Draw2DText win gt Draw2DText 59 255 ED E 0 E 0 EQUO t 0 t 0 t 0 E 0s t 0 t 0 t 0 t 0 E D t 0 ED t 0 E 0 t 0 E 0 t 0 t 0 t 0 E 0 t 0 t 0 t 0 E 0s t 0 E 0 t 0
55. T TETU HHScreamer h Screamer interface Zd T TETU ifndef HH SCREAMER H define HH SCREAMER H include HHListener h The interface that must be implemented to make a class use the HHListener HHScreamer relationship See HHListener for more information on this xy class HHScreamer 63 public virtual void setListener HHListener newListener 0 W fendif C 4 The mouse handler MI MdaMMLMIIIBPMIMEEEIIIPCBglllll VV VII I IP gl lll AAA AAT HHMouseHandler h The mouse handler TT LL ifndef HH MOUSE HANDLER H define HH MOUSE HANDLER H include wt h include wtcpp h include HHScreamer h enum HHMsDblClk NONE LEFT MIDDLE RIGHT Is used to show if there has been a doubleclick Contains all the information the mouse handler needs to send to the application jr typedef struct HH MOUSE DATA int deltax int deltaY FLAG leftButton FLAG middleButton FLAG rightButton HHMsDblClk doubleClick HHMouseData A class that is used to handle the mouse instead of WTK s own mouse routines which are working in a very strange way The mouse handler implements the HHScreamer interface which makes communcation with the application possible The handler reads raw data from the mouse and interprets these in a way that is proper for HHVirtualManual s class HHMouseHandler public HHScreamer public HHMouseHandler HHMouseHandler HHLis
56. TK is a complete VR development package that is very pleasant to work with All expected functionalities are provided and everything runs smoothly As mentioned earlier WTK applications do not get as high frame rate as applications written using VTREE This is a serious disadvantage since the performance is very important to the quality of an application Another disadvantage is the lack of complete object oriented support which can be a nuisance when writing C applications One thing that inclines towards WTK is that many systems that are used at SAAB Bofors Dynamics are provided by the same vendor as WTK The advantage of choosing systems from the same vendor is that the systems may work better together and the support may become easier since the same company maintains all of the systems WTK is evaluated further in chapter 5 where the design of a testbed created using WTK is described Excellent Level of abstraction Connection to I DEAS Hierarchical transformation Rotation in any chosen poin Different levels of immersio Table 4 2 WTK conclusion 16 4 2 VTree VTREE is a robust library of C classes and functions designed to empower you to create rich dynamic graphical scenes S VTREE is a complete SDK for the creation of 3D visualizations of varying use It has great support for environmental visualizations and in particular for military real time simulations Just like WTK VTREE is a complete pack
57. ULL theParent WtGroup theParent DeleteChild theLocation rockOn TRUE separateNode whole o3928 TOP if NULL theParent WtGroup theParent DeleteChild theLocation 89 rockOn TRUE separateNode whole Left turret TOP if NULL theParent WtGroup theParent gt DeleteChild theLocation rockOn TRUE separateNode whole Right turret TOP if NULL theParent WtGroup theParent gt DeleteChild theLocation WtMovable top gt GetTransform topTrans ROR RK KR KK ke ke ke ke ke e e MISSILE RELATED CODE KCkCk ck ckck ck kc kck ko kc kk ke kk ke ke ke ke ke ke ke x Loads the geometry needed for the missile x void HHBamse loadMissile missile MovNodeLoad xMissile wrl 1 f missile gt SetName Missile motor MovNodeLoad xMotor wrl 1 f motor gt SetName Motor WtGroup missile gt AddChild motor WtMovable motor gt GetTransform initMotorTrans WtMovable missile GetTransform initMissileTrans Shoots a missile from one of the turrets specified by whichOne K BOOL HHBamse shoot int whichOne if missileRun if whichOne 3 amp amp leftElevate whichOne 3 amp amp rightElevate amp amp leftRun amp amp rightRun WtMovable motor gt SetTransform initMotorTrans WtMovable missile gt SetTransform initMissileTrans if whichOne lt 3 WtGroup left
58. WIN WIDTH WIN HEIGHT myRoot gt LightNodeLoad LIGHTS FILENAME if myGeometry gt addAsChild myRoot if displayTree myRoot gt Print myWindow ZoomViewPoint myView gt GetPosition origPos myView gt GetOrientation origOrient WtUniverse SetActions HHVirtualManual HHActionFn myWindow gt SetFgActions HHVirtualManual HHFgDrawFn myWindow gt SetDrawFn HHVirtualManual HHDrawFn Uncomment this line if a picture should be used as the background WtKeyboard Open WtUniverse Ready displaySplash WtUniverse Go 54 WtKeyboard Close WtUniverse Delete return 0 else return 1 Since HHVirtualManual implements the HHListener interface this method is needed It enables the transfer of data between the mouse handler a HHScreamer and the application The information that is received from the mouse handler is a HHMouseData struct which is sent as an void The information is extracted and relevant actions are taken for example rotation of the geometry x7 void HHVirtualManual listen void data float transX transY int x0 y0 width height WTpoly pickedPoly WtNodePath nodePath WtP2 point WtP3 point3D if demoOn transX float HHMouseData data gt deltaX transY float HHMouseData data gt deltaY if NONE HHMouseData data gt doubleClick if HHMouseData data gt leftButton myGeometry rotate transY t
59. age for development of 3D and VR applications that are runnable on ordinary Windows NT or UNIX workstations with or without VR hardware 5 As mentioned above VTREE performs better than WTK i e VTREE has a higher frame rate Otherwise the two environments have about the same to offer to a developer One major difference though is that VTREE is written in C WTK in C and offers a complete object oriented structure capable of inheritance dynamic binding and polymorphism This is a gap that unfortunately exists in WTK s object oriented support Since VTREE is partly directed towards military and environmental visualizations it has also a big library of special effects and other features that WTK lacks 4 2 1 Level of abstraction As shown in Figure 4 1 VTREE has a slightly lower level of abstraction than WTK This allows a developer to better control the creation of an application especially the lower levels of the scene graph the different nodes in the scene graph and the geometry The negative aspect of this is that the developer has to do more work But a careful design may allow for extensive reuse of code in subsequent projects 4 2 2 Connection to I DEAS There is very little information about the file formats supported by VTREE The primary format used is VTREE s own and geometries in other formats have to be converted using some software which is included in the VTREE software package 4 2 3 Hierarchical transformat
60. am loop and disregard object oriented rules or include the program loop as a static method in some class I chose the latter approach in which the action function is implemented as a static method in HHVirtualManual In the action function the keyboard is read and corresponding actions are taken as described in section 5 1 After that HHVirtualManual tells the HHMouseHandler to check the mouse If anything interesting happens to the mouse the HHMouseHandler will inform the HHVirtualManual about this via the HHListener HHScreamer relationship If for example a missile turret is to be elevated or de elevated the HHBamse assigns a task to that movable part A task is a function in functional programming terms thus the C programmer has to use a static method as described above regarding the action function This function executes outside the normal program loop or action function All tasks are executed after the action function but before the scene is rendered This means that changes to objects can be made automatically through the use of a task I have used this in such a way that each task is assigned to a specific geometry for example a missile turret and then rotates it a little bit in each program loop until a given value has been reached e g the turret is fully elevated This results in the effect of the missile turret elevating itself after a user has double 40 clicked on it When the application enters the demo mode a spec
61. amics if VRML is chosen to be the environment to develop VR applications The problem is that in late 1998 SGI decided to stop financing both the VRML development and COSMO WORLDS Now it is impossible to find a vendor that sells COSMO WORLDS A replacement editor has to be found There is a plethora of different VRML software available over the Internet today but we have found that most of the products are of low guality For example no VRML editor that have been tested other than the aforementioned COSMO WORLDS has managed to open a VRML file exported from I DEAS which is an obvious sign of insufficient VRML support It 26 seems that there is no high guality VRML editor that can be seen as a replacement of COSMO WORLDS Unless this situation changes VRML will not have a future especially not as a tool for SAAB Bofors Dynamics activities 4 5 4 Level of abstraction VRML is a language in itself and as such is quite easy to work with The way that VRML describes geometry is easy to understand for someone who has a basic understanding of 3D graphics There are also plenty of tools that help a developer in the creation of a VRML world The fact that VRML is a language of its own is both a strength and a weakness The strength is that it is structured in a way that is specially designed just for 3D use The weakness is that a developer has to learn a new language which is quite different from all programming languages since it describ
62. ariables WtNode whole turret The geometries WtP3 extents The extents of the turret geometry the box Task variables FLAG taskRunning Is a task active right now int currentAngle The actual angle if a task is running WtTask rotationTask The task fendif FLLLALLLLLLLSALALLLLLLLLLLLLALLLILLLLLLLOSLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLEL HHRotation cpp The test geometry 1 UT TTL TTL T LT LL TTL TTL TL T include HHRotation h 67 kok k k oko kok k oko k oko kok kok kok k kok kok kok k kok k kok Ck Ck kk k kok k kok k kok k kk k k kk k k kk k kk k kk k ke kk k kk k k k kk kkk PUBLIC METHODS eK RH k kok k kok k kok k k oko kok kok kok k kok kok kok k kok k kok kok kok k kok k k kok k kk k kk k KRK k k kk k kk k kk kk kk kkk kkk The default constructor Creates a new HHRotation instance and loads it s geometry x HHRotation HHRotation loadGeometry taskRunning FALSE The destructor Deallocates the memory that the instance has used HHRotation HHRotation destroyGeometry Adds the HHRotation geometry as last child to the specified group node parent The return value is the result of the operation TRUE FALSE xy FLAG HHRotation addAsChild WtGroup parent return parent AddChild whole Rotates the specified geometry part around the specified axis x Y Z The angle radians should of cour
63. aries for instance VTREE in terms of the frame rate 4 1 1 Level of abstraction WTK is the development environment with the second highest level of abstraction as shown in Figure 4 1 Almost every aspect of the development of a 3D application is encapsulated in WTK s functions The creation of an application is a quite easy task On the other hand this can also pose a problem because the SDK hides much of the functionality that a developer perhaps wants to change or to implement in a different way If a situation presents itself where the functionality that is implemented in WTK is not satisfactory and need to be changed this is practically impossible 4 1 2 Connection to I DEAS WTK has the ability to import the following formats 12 AutoDesk DXF AutoDesk 3D Studio mesh Wavefront OBJ MultiGen ModelGen Flight VideoScape GEO Pro Engineer RENDER SLP Sense Neutral File Format Sense8 Binary NFF VRML 1 0 VRML 2 0 Table 4 1 WTK import formats In addition to these file formats Sense8 offers a CAD geometry loader to WTK This loader is not included in the standard WTK package and has to be purchased additionally to the approximate price of 10 000 The format that is currently of most interest is VRML 2 0 since that is the format supported by both WTK and I DEAS As it happens WTK has problems with the import of VRML 2 0 files An investigation leads to the following hypothesis A VRML 2 0 scene con
64. bout that specific part The information is presented in the same window on top of the 3D model By double clicking on either of the missile turrets the user can elevate or de elevate them depending on if they are elevated or not The same thing can be done to the radar pylon To illustrate these events Figure 5 1 a shows the BAMSE unit with de elevated missile turrets and elevated radar pylon Figure 5 1 b shows the same BAMSE unit with left turret elevated and the radar pylon de elevated a b Figure 5 1 A Bamse unit 32 If the user holds down the left mouse button and moves the mouse the viewport zooms in or out depending of the direction of the movement If on the other hand the user holds down the right mouse button and moves the mouse the model is rotated Holding down the middle mouse button and moving the mouse results in the rotation of the cannon turrets on the BAMSE station The radar can be controlled using the arrow keys The up and down arrows angle the radar ranging from 0 to 90 The left and right arrows rotate the radar ranging from 540 to 540 By pressing the numeric 1 4 keys a user can shoot missiles from one of the turrets The chosen turret must be elevated in order to shoot missiles All these different features are illustrated in the following figures Figure 5 2 a show the BAMSE unit with rotated turrets In Figure 5 2 b the BAMSE unit has a slightly rotated radar Finally Figures
65. cked screamerData gt middleButton middleClicked screamerData gt rightButton rightClicked ScreamerData doubleClick NONE lastX currentX lastY currentY else if buttonData amp WTMOUSE_LEFTDBLCLR buttonData s WIMOUSE_MIDDLEDBLCLK buttonData 4 WTMOUSE RIGHTDBLCLK screamerData new HHMouseData screamerData gt deltaX currentX screamerData gt deltaY currentY screamerData gt leftButton screamerData gt middleButton screamerData gt rightButton FALSE if buttonData amp WTMOUSE LEFTDBLCLK screamerData gt doubleClick LEFT else if buttonData amp WTMOUSE RIGHTDBLCLK screamerData gt doubleClick RIGHT else if buttonData amp WTMOUSE MIDDLEDBLCLK screamerData gt doubleClick MIDDLE if NULL screamerData amp amp NONE screamerData gt doubleClick 0 screamerData gt deltaX 0 screamerData deltaY myListener gt listen screamerData BRK K k k kok k k kok RK k k k k kok k k kk kk kk k kk k k k ke x delete screamerData C 5 The geometry interface VIVAS SA AA SAN ASEA AA AAA LL HHGeometry h Geometry interface TITTTTTTTTTTT ATTA TATA TATA ATTA TTT ifndef HH GEOMETRY_H_ define HH GEOMETRY H include wt h include wtcpp h The interface that specifies how all geometry classes should be structured Contains all methods that are of interest to a geometry class This HHGeometry is modified to sui
66. dels in real time visualizations These accurate simulations are used for exact predictions of a scenario and are calculated over a large time span On the other hand it is possible to pre calculate data and then feed it to a real time visualization This project does not span all the ingredients of accurate simulation it is mainly focused on visualization Visualization in turn is a multi faceted task ranging from the illustration of simple graphs and tables to three dimensional 3D presentation of a sequence of actions The particular area of interest in this project is computer aided 3 dimensional visualizations of real time calculated data To achieve the visualization in real time simplified models of behavior are required This principle applies in many of today s popular computer games where speed is crucial for viewing pleasure Other possible areas of application include architecture design and prototyping education conferencing military training simulators scientific visualization and surgical practice SAAB Bofors Dynamics connection to the defense industry leads to the particular area of military training simulators and demonstrators These include but are not limited to driving flight ship and tank simulators 1 2 Three dimensional graphics In this section a short introduction to 3D graphics provides the reader with a basic understanding of 3D graphics programming The coordinate system shown in Figure 1 1 is fundame
67. e whole turret The geometries WtP3 extents Extents of the turret geometry FLAG rockOn Is used to recursively search for a sub geometry Task variables FLAG taskRunning Is a task running right now int currentAngle The current angle if a task is running WtTask rotationTask The actual task FLAG taskElevate Shall the turret be elevated or de elevated fendif UT M LT TL TTL T L E P P PME P P PP P P P P P PP T L T HHRotation2 cpp The test geometry 42 UM TT TT T L T L TL TTL TT T L TT include HHRotation2 h kok k ko kok kok k kok k k oko kok kok kok k kok kok kok k kok k k kok kok kk k kok kok kok k kok k kk k k kk k kk k kk k k kk k kk k kk k k kk kkk k PUBLIC METHODS BR K K k kok k kok k ko kk Ck ko kk Ck Ck kk ko kok k k kk Ck kok ke kok kok kk Ck kok k k kok kok kk Ck ko kk k kok k kok k kk k k kk k kk k kk k k ke kk KK ke The default constructor Creates a new HHRotation2 instance and loads it s geometries tf HHRotation2 HHRotation2 loadGeometry taskRunning FALSE taskElevate FALSE The destructor Deallocates the memory used by the instance HHRotation2 HHRotation2 destroyGeometry 70 Adds the HHRotation2 geometry as last child to the specified griup node parent The return value is the result of the operation TRUE FALSE Ko FLAG HHRotation2 addAsChild WtGroup pare
68. e and one for the right eye are rendered into a single display and then swapped at 120 Hz to generate a field sequential view at 60 Hz This requires the graphics hardware to support quad buffering i e there are four image buffers because each image needs a front and a back buffer The display also must be capable of supporting 120 Hz update frequency 2 15 The over under mode splits the display in two parts along the horizontal axis The left eye image is rendered above the right eye image This mode also requires a display that supports 120 Hz update freguency 2 The interlaced mode interleaves the left and right images as alternate scan lines in a single window All the even scan lines belong to the left eye image and all the odd scan lines belong to the right eye image or vice versa 2 WTK also supports many sensor devices such as trackers joysticks and VR gloves Among the supported devices are Virtual Technologies CyberGlove Ascension s Bird Motionstar Flock of Birds Extended Range Bird Fakespace s Pinch Glove Logitech s Head Tracker and Polhemus ISOTRAK ISOTRAK II InsideTRAK FASTRAK Stylus The VR hardware support that WTK provides should be able to satisfy most of users needs In the case a certain sensor device is not supported WTK provides a set of functions that allows a developer to write specialized drivers to make the device function with WTK applications 4 1 6 Conclusion W
69. e behind the 3D scene 7 void HHVirtualManual HHDrawFn WtWindow win FLAG eye win gt LoadImage sky3 tga 0 999f FALSE TRUE 56 void HHVirtualManual HHFgDrawFn WtWindow win The function that draws the 2D content FLAG eye extern HHVirtualManual application win gt Set2DColor 255 win gt Draw2DText 0 f 255 255 0 005f if application gt demoOn win gt Set2DColor 255 0 0 win gt Draw2DText 0 89f 0 005f DEMO MODE win gt Set2DColor 0 0 0 switch application gt currManState case BAMSE_IDLE VirtualManual win gt Draw2DTex win gt Draw2DTex win gt Draw2DTex nedtryckt Rotera win gt Draw2DTex klick Aktivera win Draw2DTex nedtryckt Rotera lavett win Draw2DTex nedtryckt Zooma win Draw2DTex win Draw2DTex missil win gt Draw2DText 0 OT 0 15 4 win Draw2DTex mode av p win gt Draw2DText vyn win gt Draw2DText till f nster win gt Draw2DTex denna hj lp win gt Draw2DTex specificationer win gt Draw2DTex Avsluta break case BAMSE WHOLE Luftv rnsrobotsystem win gt Draw2DTex win gt Draw2DTex den svenska regeringen win gt Draw2DTex utveckling av luftv rnsrobotsystemet RBS win gt Draw2DTex systemet r ett win gt Draw2DTex mellan Bofors Missiles och win gt Draw2DTex Systems i vilket Bofors har win gt Draw2DTex
70. eTrans motorTrans int missileCount float motorAngle BOOL missileRun missileSeparated 3 endif TTL LL HHBamse cpp The Bamse geometry class TTL L LL AAA ATA AAA TAA include HHBamse h 78 JE E K K k ko kok kok k kok k KOKK kok ok oko k oko A k oko KRK k ko kok A kok ok k kok kok kok kok KRK ke kk k k k k k k k PUBLIC METHODS BR HK ko kok kok k kok k oko kok k kok k oko KRK KKR oko kok kok k k k k k k kok kok kok ok k k ko kok kok kok k k k k k kok k k k k k k k The default constructor Creates a new HHBamse instance and loads it s geometry HHBamse HHBamse loadGeomet ry Initiates task variables leftRun FALSE rightRun FALSE poleRun FALSE leftElevate FALSE rightElevate FALSE poleElevate TRUE leftTask NULL rightTask NULL poleTask NULL radarTask NULL screenTask NULL radarAngle screenAngle 0 f missileTask NULL missileRun FALSE elevateOther FALSE The destructor De allocates the memory used by the instance EA HHBamse HHBamse destroyGeometry Adds the HHBamse geometry as last child of the specified group node parent The return value is the result of the operation TRUE FALSE a FLAG HHBamse addAsChild WtGroup parent return parent AddChild whole Rotates the specified part of the geometry around the given axis X Y Z NOT USED THUS NOT IMPLEMENTED Ef
71. eak case RTURRET right gt AddChild currentNode break 87 currentNode case POLE pole AddChild currentNode break case HEAD head gt AddChild currentNode break case TOP top AddChild currentNode break case RADAR radar gt AddChild currentNode break case SCREEN Screen AddChild currentNode break rockOn FALSE else int children WtGroup currentNode NumChildren if 0 children for int i 0 i lt children i separateNode WtGroup currentNode gt GetChild i nodeName whichPart He void Performs all the calculations needed to convert the missile turrets to movable nodes HHBamse computeTurrets left new WtMovSep NULL left gt SetName Left turret rockOn TRUE separateNode whole DOF H RampV12 LTURRET if NULL theParent WetGroup theParent gt InsertChild left theLocation WetGroup theParent gt DeleteChild theLocation l rockOn TRUE separateNode whole H_RorVU13 LTURRET if NULL theParent WtGroup theParent gt DeleteChild theLocation rockOn TRUE separateNode whole H RorVN14 LTURRET if NULL theParent WtGroup theParent gt DeleteChild theLocation left gt GetExtents leftExt WtMovable left gt GetTransform leftTrans Search for right turret right new WtMovSep NULL right gt SetName Right turret rockOn TRUE
72. ecMode raddAsChild HHActionFn birotate HHDrawFn rotate g HHFgDrawFn ichkNode HHDemoTask SgetMidpoint X g displaySplash G MoadGeometry gPup dateMH andler gfdestroyGeometry N PresetViewport W gProtateViewport OA bw amp zoomViewport 4 V E om pleteScene N ProckNroll X uw ode gradar Lg o HHRotation97 a SHHRotationTask P ee LES S ML amp fturretRotation HHRotation HHRotation2 VgftocateTuret C HHRotationTask a HHRotationTask amp ue perenn E eed lt turretRotation ze 2 RS d if s eparateTurret ke Figure 5 5 The detailed design of the geometry handling The three children are geometry classes that have been used for evaluation purposes only They contain the simple geometry that is shown in Figure 4 3 This geometry consists of one cylinder and a box that has two cones as children i e it is a hierarchical structure The basic idea is that the box and its children should be able to rotate while the cylinder is unaffected 36 To achieve this HHRotation simply loads the geometry from two files where the movable part is separated from the rest of the geometry This is the usual method used to create movable parts of a geometry It is not satisfactory for use at SAAB Bofors Dynamics though since it complicates the connection to I DEAS the geometry has to be divided i
73. elete HHRotation2 myRotation gt rotationTask J KCKCKCKCk k kok kok k oko k oko kok kok kok ko kok k k kok k kok k k kok kok kok k kok k k kok A kk k k kk k k kk k kk k k kk k kk k I ke ke ke ek PRIVATE METHODS KRK BR HK k kok KKR KOKK KOKK KR KRK ko kok k k kok kok kok ko kok kok kok k kok k k kok kok kk k kok k KRK k k kk k k kk k kk kk k ke ke ke Loads all the geometries used in the instance Also makes sure that the location and rotation of the geometries are correct a VRML 1 0 geometry must be rotated 180 degrees Ef void HHRotation2 loadGeometry float trans 3 2 2 Uy WtP3 turretTrans trans whole MovNodeLoad rotateT wrl 1 f rotate wrl for an untextured geometry whole SetName Whole rockOn TRUE SeparateTurret whole WtGroup turret GetExtents extents WtMovable whole MovAxisRotation Z PI Destroys the geometry that previously have been loaded PRECON Geometry must have been loaded with loadGeometry Ref void HHRotation2 destroyGeometry delete whole delete turret Rotates the HHRotation2 instance s turret geometry the given angle in radians 72 around a point that is located in the geometry s left end Ef void HHRotation2 turretRotation float angle WtP3 translation translation 0 translation 1 extents 1 translation 2 0 WtMovable turret gt Translate translation WTFRAME LOCAL ex
74. en WorldToolKit s and I DEAS coordinate systems 41 25 59 Implementation Issues niena ea a R E di Le cca en CN AR eas need 41 5 5 1 Coordinate systems 5 5 2 Viewpoints 5 5 3 Project settings 5 5 4 Flaws and errors 6 Re ommendations ssossssocesossvsossoooooooco0rsoveooo0000000000000000000000000000000000000000000000000000000000000 44 6 1 World TOG UR atu od s tete esse tecea lense a der cepa TE E E a 44 Gide OV ECGs sask EE 44 6 3 Cosmo 3D OpenGL Optimizer and VR Juggler eene 44 m Mlle EP 45 Referents REPRE E FS A Future features implementing Virtual Reality hardware 47 AT Head Motinted Displays sfr rn hene T SEHR Ee N aa Eass 48 vii AD GITEN 49 I CDEROKGESS o e etae oea ivre o ioo deri ssd O grn O segerns tee siete Dun tee ose iUe 49 GIOSSHPV Oh 50 Source code aed cece ssstnnctbenepcecavadbucasivcsscoasaupoeicdusussueabenesusissuceauasposaduneecsupanabeuetssconteonseneestune 52 C1 Nema UAE EG Saku D oo o o 32 C2 The appligatioficus s osos au dtd solo ona SR de I EI UR EUM a bo old 52 C 3 Listener and SCIEamer intesa eo o inna ee nee Sada RAEE re uad Ra eae EUR 63 C4 IDBeqnogse handler o on cde rnar a esae oe sa ts an dpa Rabi DE 64 C5 Thegeometry interface aseo de ttsestota ntl addi tact olo pcd pe nM Ud eU 66 C6 The HH Rotation classes 4 nett roe PSI PR RS ERR Hes a NL S EH AP IRR E DN
75. en one wants to textually display information along with the 3D scene or when one is creating a heads up display HUD The important matter is that the 2D coordinate system is somewhat strange the lower left corner has the coordinate 0 0 0 0 and the upper right corner has the coordinate 1 0 1 0 Usually the origin of such coordinate systems is located in the top left corner of the screen If one just keeps this in mind this should not be a problem This kind of relative coordinates is otherwise very useful because there is no need to keep track of what size the current window has since the upper right corner always has the coordinates 1 0 1 0 5 5 2 Viewpoints It is important to keep in mind that some file formats contain more information or objects than what is displayed An example of this is that VRML files can contain viewpoints called Cameras in VRML When a VRML file that contains a camera is imported into WTK this camera is added to the universe s list of viewpoints However it cannot be modified as a regular viewpoint It is for example not possible to get any information about the viewpoint s camera s location or to move it which can cause quite annoying errors 42 5 5 3 Project settings It is important to have correct project settings There are different settings for different types of projects These are all described in chapter 3 of the WorldToolKit Hardware Guide 5 5 4 Flaws and errors WTK is not 100 co
76. es the world and its behaviors 4 5 5 Connection to I DEAS I DEAS exports VRML which means that basic foundation is laid All that is then needed is to specify the scene s behaviors and appearance 4 5 6 Hierarchical transformation VRML is built upon a hierarchical structure which is in fact identical to the one used in COSMO 3D and therefore supports hierarchical transformation 4 5 7 Rotation in any chosen point The principles described in section 4 1 4 also apply to rotation in VRML 4 5 8 Different levels of immersion VRML has no inherent support for different levels of immersion but does not prevent it either We have heard of solutions where HMDs are used in conjunction with VRML but have not seen any specifications of the practical details In order to get input devices such as trackers and VR gloves to work with VRML some sort of communications software between them has to be used One such software is VR JUGGLER It is not clear whether this works or not since VR JUGGLER is a C API and VRML only has inherent support for Java Another possible solution to this is to use the CORTONA SDK to handle the communication between VR JUGGLER and the VRML world This solution still needs to be verified 27 4 5 9 Conclusion VRML has one major strength i e it is designed to be used over a network Thus VRML is an excellent environment for 3D manuals that can be viewed over the Internet or over a company s Intranet Other
77. et gt SetTranslation turretTrans WtGroup turret gt GetExtents extents Far en FLAGGA som jag inte f ngar WtGroup whole gt AddChild turret Destroys the geometry that previously have been loaded PRECON Geometry must have been loaded with loadGeometry Ed void HHRotation destroyGeometry delete whole delete turret Rotates the HHRotation instance s turret geometry the given angle in radians xp void HHRotation turretRotation float angle WtP3 translation WEtMovable turret MovAxisRotation Z angle TTL LL HHRotation2 h The test geometry 2 T T TT TATA TTT 69 ifndef HH ROTATION_2_H_ define HH ROTATION 2 H include lt math h gt include HHGeometry h HHRotation2 is basically the same as HHRotation but it has a significant difference all geometries are loaded from ONE file and then separated into different parts n class HHRotation2 public HHGeometry public HHRotation2 HHRotation2 FLAG addAsChild WtGroup parent void rotate int axis float radians PI 180 void rotate const float amp transX const float amp transY int part void chkNode WtNodePath nodePath WtP3 getMidpoint Static void HHRotationTask void myRotation private void loadGeometry void destroyGeometry void turretRotation float angle void separateTurret WtNode currentNode Geometry variables WtNod
78. etManState BAMSE TURRET turretElevation TRUE break else if right currentNode NULL name amp amp 0 strcmp name right gt GetName application gt setManState BAMSE TURRET turretElevation FALSE break else if pole currentNode NULL name amp amp 0 strcmp name pole gt GetName application gt setManState BAMSE POLE if poleRun if poleElevate headAngle 180 poleAngle 90 poleElevate FALSE else headAngle poleAngle 0 poleElevate TRUE if 0 radarAngle radarTask new WtTask this HHBamse HHRadarTask 1 f if 0 screenAngle screenTask new WtTask this HHBamse HHScreenTask 1 f 80 poleRun TRUE HHBamse HHPoleTask name amp amp 0 poleTask new WtTask this break else if whole currentNode NULL gt GetName application gt setManState BAMSE WHOLE currentNodeNum Returns the midpoint of the whole geometry ay WtP3 HHBamse getMidpoint WtP3 midpoint WtGroup whole gt GetMidpoint midpoint return midpoint void HHBamse nullAll BOOL j WtMovable radarAngle screenAngle 0 0 SES if justOrient A ustOrient WtMovable whole gt SetTransform wholeTrans WtMovable top gt SetTransform topTrans WtMovable radar gt SetTransform radarTrans screen gt SetT
79. ether these two classes implement all input handling As shown in Figure 5 4 there are two abstract classes included in the input handling HHListener and HHScreamer These two interfaces represents a relationship widely used in Java namely that of events and event listeners HH VirtualManual inherits from HHListener thus making it an event listener HHMouseHandler inherits from HHScreamer which enables it to generate events which HHVirtualManual can listen to This simple structure makes it possible for HHMouseHandler to send information scream to HHVirtualManual This would otherwise be impossible since HHMouseHandler is instanced in HHVirtualManual Thus it is possible for HHVirtualManual to invoke one of HHMouseHandler s public methods but not vice versa 35 This design is used to minimize the information flow between HHVirtualManual and HHMouseHandler HHMouseHandler only send information to HHVirtualManual when it is necessary 1 e when something interesting has happened to the mouse for example a button click The geometry handling consists of several different classes as shown in Figure 5 3 HHGeometry is an abstract class that defines how a geometry class i e a class that encapsulates some sort of geometry should be structured It has four children of which three can be separated from the fourth A Aen dA HHVirtualManual X d ES run a Ss etManState HHGeometry s etSp
80. f just one point VR Virtual Reality VRML Virtual Reality Modeling Language WTK WorldToolKit WWW World Wide Web 51 C Source code This appendix contains all the source code that have been written during this project The source code is divided into different sections based on the design described in chapter 6 2 Each section contains the header file as well as the source code file if one exists abstract classes only have headers files Each file begins with a comment describing the content as shown at the top of section C 1 below AI the classes and methods are commented directly in the source code Thus there are no need for more descriptions C 1 The main function TT T L T T LL TL T LL main cpp The main function UT T TT TTT TTT TTT include lt iostream h gt include HHVirtualManual h Global variables HHVirtualManual application The application must be global so that the global static action functions can access it The main function which instantiates HHVirtualManual i e the whole application and then runs it At the end it shows whether the execution was a success or not Ef int main void application new HHVirtualManual if 0 application run cout lt lt Application successfully executed lt lt endl return 0 cout lt lt Failed to properly execute application lt lt endl return 1 C 2 The application LLLLLLALLLLLLLLLALLLSALLLLL
81. geometry back to its original position Steps 4 to 6 are actually the same procedure as the rotation in any chosen point described in section 4 1 4 the evaluation of WTK The only difference is that a coordinate from I DEAS is used after a conversion 5 5 Implementation issues There are some issues that are important to keep in mind when developing applications using WTK I ran into four of them and they are discussed in the following sections 41 5 5 1 Coordinate systems WTK uses the coordinate system shown in Figure 5 9 When compared to the coordinate system shown in the introduction Figure 1 1 one can see that the y axis is inverted This can cause some problems when importing models from formats that use another coordinate system An example of this is VRML 1 0 which uses the previously mentioned coordinate system with an y axis pointing up The result of this is that when one imports a geometry from a VRML 1 0 file this geometry is displayed up side down in WTK An easy solution to this problem is to rotate the geometry 180 around the z axis or the x axis directly after loading it However this problem does not exist when loading the geometry from a VRML 2 0 file 0 0 0 Figure 5 9 WTK s coordinate system There is another occasion when it is important to keep the coordinate system in mind In WTK it is possible to draw 2D objects images points lines text etc on top of the 3D scene This is very useful wh
82. ial task is assigned to handle all the functionality described in 5 1 i e the zooming the rotations etc The source code of the testbed where each method and class is commented is included in Appendix B 5 4 Connection between WorldToolKit s and I DEAS coordinate systems One task in the evaluation of WTK was to find a method to locate a specific point in the coordinate system for a specific geometry given the global coordinates of this point in I DEAS described in requirement 3 2 6 The following procedure accomplishes that task Note that the whole scene has a global coordinate system and each geometry node has a local coordinate system of its own 1 Calculate the full transformation for the given geometry node there are functions in WTK to do this The result is the coordinate of the local coordinate system s origin in the global coordinate system 2 Inverse the result of step 1 x y z to get the coordinate of the global coordinate system s origin in the local coordinate system 3 Subtract the rotation point s coordinate the one taken from the global coordinate system of I DEAS from the result of step 2 4 Translate the result of step 3 so that it is located in the origin of the local coordinate system 5 Perform the actual rotation that is the goal of this procedure This usually is around one or more of the three axes X Y and Z 6 Perform an inverse translation of the one in step 4 i e translate the
83. ion VTREE uses a hierarchical scene graph to organize all geometries As mentioned in 3 2 3 all systems that use a hierarchical representation also allow hierarchical transformation which means that VTREE does support hierarchical transformation 4 2 4 Rotation in any chosen point The basic method described in the evaluation of WTK paragraph 4 1 4 is also applicable for VTREE The first operation is to translate the geometry so that the chosen point is located in 17 the geometry s origin The second operation is to rotate the geometry The final operation is to translate the geometry back to its original position 4 2 5 Different levels of immersion VTREE supports stereographic viewing which means that applications can use HMDs and similar output devices as a computerized binocular widely used in military simulations The VTREE user manual provides no other information concerning the types of stereographic viewing that are supported see the evaluation of WTK section 4 1 5 other than that VTREE supports HMDs VTREE also supports a variety of trackers for example Intersense s S300 and InterTrax Ascension s Flock of Birds and Polhemus FasTrak as well as different joysticks and other 3D input devices To our knowledge VTREE provides no support for VR gloves so we have to assume that this does not exist 4 2 6 Conclusion VTREE is already in use at SAAB Bofors Dynamics which makes VTREE a suitable candidate for VR
84. le rockOn FALSE locateTurret whole if NULL turret WTmessage Unable to trace turret n Destroys the geometry that previously has been loaded PRECON The geometry has been loaded using loadGeometry n void HHRotation97 destroyGeometry delete whole delete turret Rotates the HHRotation97 instance s turret geometry the given angle in radians around a point that is located on the geometry s left end void HHRotation97 turretRotation float angle WtP3 translation translation 0 extents 0 translation 1 extents 1 translation 2 0 WtMovable turret gt Translate translation WTFRAME LOCAL 76 WEtMovable turret MovAxisRotation Z angle translation 0 1 translation 1 1 WtMovable turret gt Translate translation WTFRAME LOCAL Separates the turret part of the geometry from the others DOES NOT WORK WITH VRML 2 0 k void HHRotation97 locateTurret WtNode currentNode if rockOn char name currentNode gt GetName if NULL name amp amp 0 strcmp name Turret turret currentNode rockOn FALSE else int children WtGroup currentNode NumChildren if 0 children for int i 0 i lt children i locateTurret WtGroup currentNode gt GetChild i children WtMovable currentNode NumAttachments if 0 children for int i 0 i lt children i l
85. le int part void poleRotation float angle void headRotation float angle void topRotation float angle void radarRotation float angle void screenRotation float angle void computeTurrets void computePole void separateTop void separateNode WtNode currentNode char partName HHParts whichPart void loadMissile Geometry variables WtNode whole WtGroup left right top WtP3 leftExt rightExt The extent of the turret geometries WtGroup pole head radar screen WtP3 poleExt headExt screenExt WtM4 poleTrans headTrans wholeTrans topTrans leftTrans rightTrans radarTrans screenTrans float radarAngle screenAngle Seek variables FLAG rockOn Is used to seek recursively for a sub geometry WtNode theParent The parent of the sought node int theLocation The location at the parent that the sought node was located Task variables BOOL leftRun rightRun Is tasks running int leftAngle rightAngle The actual angles if tasks is running WtTask leftTask rightTask The tasks BOOL leftElevate rightElevate Should we elevate or de elevate BOOL poleRun poleElevate elevateOther int poleAngle headAngle WtTask poleTask radarTask screenTask missileTask Missile related WtNode missile motor WtP3 mTranslation moTranslation WtM4 initMissileTrans initMotorTrans missil
86. m s Rotates the radar the given angle void HHBamse headRotation float angle WtM4 r s WtP3 translation 85 void HHBamse WtMovable WtMovable WtMovable WtMovable WtMovable translation 0 translation 1 translation 2 WtMovable WtMovable translation 1 WtMovable WtMovabl WtMovabl kj WtM4 h p GetTransform r GetTransform s radar screen head radar screen SetTransform headTrans SetTransform radarTrans SetTransform screenTrans 0 headExt 1 0 head gt Translate translation WTFRAME LOCAL head gt MovAxisRotation Z angle 1 head gt Translate translation WTFRAME LOCAL e radar SetTransform r e screen SetTransform s Rotates the base of the missile turrets the given angle topRotation float angle WtP3 translation tMovabl tMovabl tMovabl tMovabl tMovabl tMovabl tMovabl tMovabl tMovabl tMovabl tMovabl tMovable screen missileRun Ly ty Ed 58 e head gt GetTransform h e pole gt GetTransform p e left gt GetTransform 1 e right GetTransform r e radar GetTransform rd e screen GetTransform s e head gt SetTransform headTrans e pole gt SetTransform poleTrans e left gt SetTransform leftTrans e right gt SetTransform rightTrans e
87. more flexible than WTK However it does not have as much VR support While WTK is excellent for product prototyping VTREE is more directed towards large scale simulations such as environmental visualizations VTREE also lacks the import capabilities that WTK offers Since SAAB Bofors Dynamics already uses VTREE in simulations and visualizations it could be practical to also use VTREE in the VR development as well 6 3 Cosmo 3D OpenGL Optimizer and VR Juggler The combination of COSMO 3D OPENGL OPTIMIZER and VR JUGGLER provides the same flexibility as VTREE It also provides the same or probably better VR hardware support as WTK What the combination lacks are the special effects included in the VTREE SDK and the import capabilities of WTK Other than that COSMO 3D OPENGL OPTIMIZER and VR JUGGLER 44 offer a solid object oriented foundation for developing dynamic VR applications The fact that the three APIs are also completely free is also a positive aspect although the purchase costs are usually not an issue for a company of SAAB Bofors Dynamics size 6 4 Summary I cannot really point out one development environment that I recommend SAAB Bofors Dynamics to use It all depends on the priority WTK is great for prototyping and importing CAD data VTREE provides better performance but are directed towards a slightly different use and COSMO3D OPENGL OPTIMIZER VR JUGGLER lies somewhere in between the two WTK is developed by the
88. nd multi monitor systems as well as the input of almost any VR input and tracking device 7 Other than this there are no further descriptions of exactly which products REALAX supports Since all HMDs follow the same system actually there are a handful systems as described in section 4 1 5 but each HMD uses one of these it is quite safe to assume that REALAX really supports all HMDs The supports for input and tracking devices are harder to classify since there are many different systems It would have been 24 useful with a list of supported devices There is no possibility to explore this further in this thesis without access to the necessary hardware 4 4 6 Conclusion REALAX has proven to be disappointing When using the program we get the feeling that it is antiguated even though it is a modern program Admittedly REALAX 1s guite easy to use but it often fails to deliver what it claims to be able to accomplish Because of its multi platform support the developers have chosen to implement a GUI of their own which in our opinion is inferior to Windows inherent GUI In comparison WTK also has multi platform support but uses the platforms inherent GUIs which is a much better solution Evidently REALAX does not supply anything that SAAB Bofors Dynamics cannot already achieve with other software The conclusion of the evaluation is that REALAX is not of any value for SAAB Bofors Dynamics Level of abstraction Co
89. needs of SAAB Bofors Dynamics and the author s opinions and ideas 3 1 Method This project was carried out in four different phases The boundaries of these phases were not completely distinct because the development of software is an iterative process and the boundaries of different stages may overlap each other The first step in the project was an information gathering process This is one of the most important phases in the project since SAAB Bofors Dynamics is interested in information about available products and their use in SAAB Bofors Dynamics business After the information has been gathered it was time to evaluate available products The requirements for this are specified in chapter 3 2 The next phase was the implementation of a simple testbed This phase was actually an extension of the evaluation since the development of the testbed further evaluates the functionality of a chosen product The final phase was the documentation of the whole process 3 2 Requirements The evaluation of software and SDKs are necessary to see if they fulfill certain requirements The following paragraphs contain the requirements set up for a 3D software development environment The first five requirements are considered to be decisive for the decision whether or not to use the software The sixth requirement describes the general guidelines set up for the testbed the computerized manual Note that these requirements were not included in
90. nnection to I DEAS Hierarchical transformation Rotation in any chosen poin Different levels of immersio Table 4 7 Realax conclusion 4 5 VRML VRML is an acronym for the Virtual Reality Modeling Language VRML can be thought of as several different things VRML can simply be a platform independent 3D interchange format which the first version VRML 1 0 is designed to be Another view of VRML is a modeling language that allows specification of complete 3D scenes and worlds VRML can also be seen as a 3D analog to HyperText Markup Language HTML which provides online interactive 3D homepages 8 VRML is designed to distribute 3D worlds over the World Wide Web WWW utilizing the HyperText Transfer Protocol HTTP VRML is quite different from the other environments mentioned in this chapter VRML is not a SDK not even an API but rather a language that describes geometry and other environmental aspects of 3D scenes and worlds The current standard VRML 2 0 or VRML 25 97 includes user interactivity behavior scripting and audio support whereas the first version VRML 1 0 only described static 3D models 9 To display a VRML scene all that is needed is a VRML browser There are many different browsers available for almost all platforms usually as plug ins to ordinary HTML browsers such as Internet Explorer or Netscape Navigator on the Windows NT platform 4 5 1 External Authoring Interface The External Au
91. nt return parent gt AddChild whole Rotates the specified part of the geometry around the specified axis X Y Z The angle radians should of course be given in radians void HHRotation2 rotate int axis float radians Rotates the specified part of the geometry according to the transformation values read from the mouse Rj void HHRotation2 rotate const float stransX const float amp transY int part switch part case 0 WtMovable whole gt MovAxisRotation X transX PI 180 WtMovable whole gt MovAxisRotation Y transY PI 180 break case 1 turretRotation transY PI 180 break Controls the specified node path if any of the movable parts of the geometry is along it If so a task HHRotationTask is activated which makes sure that this sub geometry is rotated in a specific pattern different for different parts isa void HHRotation2 chkNode WtNodePath nodePath int currentNodeNum WtNode currentNode currentNodeNum nodePath NumNodes 1 char name hile 0 lt currentNodeNum s currentNode nodePath gt GetNode currentNodeNum if NULL currentNode name currentNode gt GetName if turret currentNode NULL name amp amp 0 strcmp name turret gt GetName if taskRunning if taskElevate Thus the turret is elevated time to de elevate currentAngle 60 taskElevate FALS
92. ntal to understand 3D orientation Placement and direction of the axes can vary dependent on different systems and environments The smallest building block is called a vertex and represents one point in the coordinate system Lines consist of two vertices start point and end point By connecting multiple lines basic two dimensional primitives such as triangles 3 vertices guadrants 4 vertices and polygons N vertices can be formed The most common 3D primitives are boxes cones cylinders and spheres In addition surfaces and materials are defined and solid objects can be formed Material consists of different aspects such as light dependent attributes shininess and emissiveness and colors To add further realism to the surface a texture can be applied The texture is a picture that adds the appearance of a real surface Figure 1 1 An example 3D coordinate system Transformation is used to translate and rotate an object To translate an object is to place or move it in the coordinate system Shading and lightning are other features that add realism and atmosphere to the scene A scene is a virtual environment that contains objects and attributes A graph is often used to represent the scene by ordering all attributes and objects in a hierarchic manner Figure 1 2 This means that a child inherits the attributes of its parent A very complex engine performs the actual rendering but this is out of the scope of this thesis
93. nto different files To solve this problem HHRotation2 loads the whole geometry as a single file After the file is loaded the scene graph is traversed until the specific sub geometry the box is found Then this geometry is removed from the scene converted into a movable geometry WTK separates movable geometry from ordinary non movable geometry and finally put back in the scene This way all geometry can be stored in one file and then be divided after the file has been loaded HHRotation97 is basically the same class as HHRotation2 but uses a VRML 2 0 geometry file instead of a VRML 1 0 This class has been used to evaluate WTK s VRML 2 0 support It has been proven that even if there are no PROTO nodes in a geometry it still is impossible to traverse the scene graph after loading a VRML 2 0 file Thus VRML 2 0 is useless together with WTK since it is impossible to localize specific parts of a geometry The three HHRotation classes were only used for evaluation and a fourth geometry class was created for the actual testbed HHBamse This class is more complex than the previous three classes It also contains more behaviors so it was necessary to change the interface HHGeometry 37 HHGeometry UN taddAsChild irotate irotate ichkNode igetMidpoint inullAI N ishoot utifioadG eometry estroy Geometry ny Fe HHB amse N urretElevation isLeft HHLeftTask iHHRightTask
94. ocateTurret WtMovable currentNode GetAttachment i C 7 The Bamse geometry class VM TTT TATA ATA ATA TATA TTA TAT bl lll ll P TTT TATA TTT TAT ATTA TATA AAA TATA AA AAA AAA p TT HHBamse h The Bamse geometry class TT LL TTT TTT TTT TTT ATTA ATTA TATA AAA AAT ATA AAA M MI ATTA ifndef _ HH BAMSE_H_ define HH BAMSE H include lt math h gt include HHGeometry h include HHVirtualManual h enum HHParts LTURRET RTURRET POLE HEAD TOP RADAR SCREEN BA geometry class that contains the Bamse geometry which is the geometry actually used in the testbed Is based on HHRotation2 and thus provides the same functionality but slightly enhanced as it EL class HHBamse public HHGeometry public HHBamse HHBamse FLAG addAsChild WtGroup parent void rotate int axis float radians PI 180 void rotate const float amp transX const float amp transY int part void chkNode WtNodePath nodePath WtP3 getMidpoint T void nullAll BOOL justOrient BOOL shoot int whichOne BOOL turretElevation BOOL left BOOL isLeft Static void HHLeftTask void myRotation Static void HHRightTask void myRotation Static void HHPoleTask void myRotation static void HHRadarTask void myRotation static void HHScreenTask void myRotation Static void HHMissileTask void myRotation private void loadGeometry void destroyGeometry void turretRotation float ang
95. ok Ck k k k k kok k ko kk k k k k k kk k k kk k kk k k kk k kk k kk kk kkk kkk kkk PUBLIC METHODS ee BR K K k k kok k k k k ko kok kok k k k k k k k kok k k k k k kk k kk kk kk k k k k k kk k k kk k k k k k kk k k kk k kk kk kkk kk kkk kk kkk I ek The default constructor Creates a new universe a new geometry and a mouse handler to which it registers itself as a listener x HHVirtualManual HHVirtualManual WtUniverse New WTDISPLAY DEFAULT WTWINDOW_DEFAULT WTWINDOW NOBORDER myGeometry new HHBamse myMHandler new HHMouseHandler this currManState BAMSE_IDLE HHBamse specific demoOn FALSE demoTask NULL SER The destructor Releases the memory used by the instance it s geometry and mouse handler HHVirtualManual HHVirtualManual delete myMHandler delete myGeometry Activates the application Initiates the variables that is used by the application HHVirtualManual s static function HHActionFn is registered as the universe s action function The parameter specifies whether or not a scene tree should be printed to the screen The return value is the result of the execution 0 fine 1 bad x int HHVirtualManual run bool displayTree myRoot WtUniverse GetFirstRootNode myView WtUniverse GetFirstViewPoint myWindow WtUniverse GetFirstWindow myWindow gt SetBgRGB BG RED BG GREEN BG BLUE myWindow gt SetPosition WIN XPOS WIN YPOS
96. r glasses which uses an ordinary monitor as the display 1 3 2 Virtual Reality Gloves In order to interact with the virtual world different kinds of input devices have been developed The simpler ones include wands and space pucks which can be thought of as 3 dimensional mice A more advanced device is a glove eguipped with a number of sensors that feed the computer of the user s hand motions By using this kind of device a user can grab and hold objects in the visualized world and the interactive experience is greatly enhanced 1 3 3 Trackers A third device that has been used to deepen the immersion in the virtual environment is called a tracker A tracker is a device that keeps track of the placement and orientation of the user s physical body The user s physical motions are translated to motions in the virtual world and the user gets a feeling of completely being in the generated environment 1 4 About the thesis The following section is a brief introduction to each of the chapters Background and goals Describes the background and the goals of the project SAAB Bofors Dynamics current situation and their need for this type of project Method and requirements Describes the requirements for the project and the method used in the project Results An introduction and an evaluation of the different development environments that were considered to be candidates for SAAB Bofors Dynamics Virtual Reality development Testbed
97. ransX 0 if HHMouseData data rightButton amp amp 0 transY zoomViewport transY if HHMouseData data middleButton amp amp 0 transX myGeometry rotate transX transY 5 else switch HHMouseData data gt doubleClick case LEFT myWindow gt GetPosition amp x0 amp y0 amp width amp height point 0 transX x0 point 1 transY y0 pickedPoly myWindow gt PickPoly point amp nodePath point3D if NULL pickedPoly myGeometry gt chkNode nodePath delete nodePath break case MIDDLE resetViewport break Sets the state of the manual i e the textual content that are displayed on the screen y void HHVirtualManual setManState HHManualState newState currManState newState Initiates the specification mode which shows the specifications on the screen as well as resets the geometry Ry void HHVirtualManual setSpecMode myGeometry gt nullAll FALSE resetViewport currManState BAMSE_SPEC 55 kok k kok k kok k oko k ko kk oko kk ko kok kok kok k kok k kok kok kok k kok k k kok A kok k k kk k kk k kk k k kk k kk k kk kk k kkk STATIC METHODS kk BR K K k oko kok k oko k oko kok kok k ko kok kok kok k KRK k k k kok k kok kok kok k k k k k kk k k kk k kk k kk k k kk k kk k kk k k k kkk Is used as the WTK universe s action function which is executed every program loop It reads the keyboard
98. ransform screenTrans leftRun amp amp leftElevate turretElevation TRUE if poleRun amp amp poleElevate headAngle poleAngle 0 poleElevate TRUE poleRun TRUE poleTask new WtTask this BOOL HHBamse turretElevatio n BOOL left if missileRun if leftRun amp amp rightRun if left if leftElevate leftAngle 60 leftElevate FALSE leftRun TRUE leftTask new WtTask this else if rightElevate elevateOther TRUE turretElevation FALSE else leftAngle 0 leftElevate TRUE 81 HHBamse HHPoleTask 1 f HHBamse HHLeftTask Ed Ls f strcmp name f whole leftRun TRUE leftTask new WtTask this HHBamse HHLeftTask return TRUE else if else rightElevate rightAngle 60 rightElevate FALSE rightRun TRUE rightTask new WtTask this HHBamse HHRightTask if leftElevate else elevateOther TRUE turretElevation TRUE rightAngle 0 rightElevate TRUE rightRun TRUE de f bat rightTask new WtTask this HHBamse HHRightTask return TRUE return FALSE Is the left turret elevated Return TRUE or FALSE BOOL HHBamse isLeft return leftElevate ae oe y SE E K K k ko kok kok k ko kok k oko kok kok kok k kok kok kok k kok k kok kok kok k kok kk kok A k k k k kk k k
99. rate as possible since it might be necessary to replace the geometry several times during the development of an application and some conversions deteriorates the quality of the geometry 3 2 3 Hierarchical transformation If the SDK uses hierarchical representation of the scene data see chapter 1 2 then it is possible to transform the geometry as a hierarchical structure This is useful if one wants to transform a whole group of geometries for example a missile turret consisting of several sub geometries all that is necessary is to transform a group node containing all of the associated geometry and the whole group is transformed If on the other hand it is not possible to perform a hierarchical transformation the only solution is to do calculations on each individual vertex which is a quite time consuming task 3 2 4 Rotation in any chosen point In order to implement realistic motions and animations it is necessary to be able to rotate a geometry or a whole group of geometries according to paragraph 3 2 3 at an arbitrary point in the coordinate system This is necessary since some systems only allow rotation around some global axis which is somewhat limited This requirement in combination with paragraph 3 2 2 is discussed further in 3 3 32 5 Different levels of immersion In order to be able to extend developed systems in the future it is necessary to have the ability to develop applications with higher levels of immersion
100. rrect and still contains flaws and errors especially the C wrapper classes Sense8 s homepage hittp www sense8 com provides the updates If one encounters an error in WTK it is important to notify Sense8 so that they can fix the error 43 6 Recommendations I have reached the conclusion that three development environments are suitable for SAAB Bofors Dynamics VR development WTK VTREE and COSMO 3D OPENGL OPTIMIZER combined with VR JUGGLER Each of the three has its positive and negative aspects and these are mentioned in the evaluations in chapter 4 6 1 WorldToolKit WTK is a complete VR development package that has all the functionality that are needed SAAB Bofors Dynamics already uses software systems from the same vendor and it is preferable that the whole software suit originates from the same company WTK s developer also offers a CAD conversion add on which allows WTK to import CAD data directly from I DEAS which is of great value for the development of VR applications This is the strong point of WTK It is a great tool for VR prototyping of products On the other hand WTK has some flaws in its object oriented structure that can be a nuisance when developing applications WTK also has a performance that is worse than for instance VTREE When developing large applications that run with VR hardware such as HMDs this performance loss can lead to problems such as simulator sickness 6 2 VTree VTREE is slightly
101. s 3 To provide the possibility of an object oriented development approach the WTK package also includes C wrapper classes These are C classes that encapsulate the ordinary WTK functions that are written 11 in C in a manner that allows a C programmer to use WTK Even though the C code that WTK consists of is based on object oriented concepts the C wrappers do not offer such object oriented strengths such as inheritance or dynamic binding which is obviously a serious drawback WTK is available on a plentitude of different platforms including Windows NT SGI Sun HP DEC PowerPC and Evans amp Sutherland This makes WTK a frequently used development environment that has a large user base 4 This is one of the most valuable aspects of WTK Since it has been extensively used and evaluated and most of the weaknesses should have been corrected by now WTK has reached its 9th release Another strength of WTK is that it is a complete package supporting the development of a wide variety of VR applications These applications can range from full immersive systems such as Caves to simple web browser based applications There are other softwares included in the WTK development suit WORLDUP is a viewer that displays 3D worlds in a simple way which does not include any programming WORLD2WORLD is a system used for developing distributed 3D systems that run in a network Unfortunately WTK does not perform as well as some other VR libr
102. s a void only zero values are not sent Ef void HH MouseHandler examineMouse int buttonData myMouse gt GetMiscData currentX currentY WTmouse rawdata mouseData HHMouseData screamerData NULL myMouse gt RawUpdate mouseData WTmouse rawdata myMouse gt GetRawData currentX int mouseData gt pos 0 currentY int mouseData pos 1 Check for buttons just pressed if buttonData amp WTMOUSE LEFTBUTTON lastX currentX lastY currentY leftClicked TRUE if buttonData amp WTMOUSE RIGHTBUTTON lastX currentX lastY currentY rightClicked TRUE if buttonData amp WTMOUSE MIDDLEBUTTON lastX currentX lastY currentY middleClicked TRUE kok k k kok k k kok k k kk k ke kk k kok ke kk kk ke kk kk oe ke ke Check for buttons released 65 if buttonData 4 WTMOUSE LEFTUP leftClicked FALSE if buttonData 4 WTMOUSE MIDDLEUP middleClicked FALSE if buttonData 4 WTMOUSE RIGHTUP rightClicked FALSE BRR IKK ko kok k kok k kok k k ke kk IA ke kk ke ke kk kc ke ke kok Check for other button functions if buttonData amp WTMOUSE LEFTDOWN buttonData amp WTMOUSE MIDDLEDOWN buttonData amp WTMOUSE RIGHTDOWN screamerData new HHMouseData screamerData gt deltaX currentX lastX screamerData gt deltaY currentY lastY screamerData gt leftButton leftCli
103. se be in radians a void HHRotation rotate int axis float radians Rotates the specified geometry part according to the transformation values along the X and Y axes that have been read by the mouse y void HHRotation rotate const float amp transX const float amp transY int part switch part case 0 WtMovable whole gt MovAxisRotation X transX PI 180 WtMovable whole gt MovAxisRotation Y transY PI 180 break case 1 turretRotation transY PI 180 break Controls the given node path if any of the movable parts of the geometry is along it If so a task is activated HHRotationTask which rotates this geometry x void HHRotation chkNode WtNodePath nodePath int currentNodeNum WtNode currentNode currentNodeNum nodePath NumNodes 1 while 0 lt currentNodeNum currentNode nodePath GetNode currentNodeNum if turret currentNode if taskRunning currentAngle 0 taskRunning TRUE rotationTask new WtTask this HHRotation HHRotationTask 1 f break currentNodeNum 68 Returns the midpoint of the whole geometry Ef WtP3 HHRotation getMidpoint WtP3 midpoint WtGroup whole gt GetMidpoint midpoint return midpoint JE E K K k kok k kok k oko KOKK KR KORK KOKK kok kok ko kok k ko kok kok kok k kok k k kok A kk k k kk k kk k kk k k kk k k k k k kk k k k kkk STATIC METHODS
104. sists of a scene graph which in turn consists of one or more nodes of different types as described in paragraph 1 2 There exists one special type of nodes at the meta level i e it is a node that describes nodes This type of nodes called Prototypes or PROTO nodes is used for creating and describing new specialized nodes VRML geometry exported from I DEAS consists almost entirely of PROTO nodes It seems that WTK is unable to import and interpret these nodes Sense8 has been notified of the problem but no answer has been received A solution to the problem is to convert the VRML 2 0 geometry to VRML 1 0 This is not a good solution since it involves an extra step in the connection between I DEAS and WTK VRML 1 0 is also a quite clumsy file format of much lower quality than VRML 2 0 This is illustrated in Figure 4 2 where the same geometry is viewed in VRML 1 0 format to the left and in VRML 2 0 format to the right 13 Figure 4 2 Comparison of VRML 1 0 and 2 0 4 1 3 Hierarchical transformation All scenes in WTK are structured in a hierarchical manner which as described in section 3 2 3 means that WTK allows hierarchical transformation 4 1 4 Rotation in any chosen point Every sub geometry in WTK has a local coordinate system where the origin is placed at the geometry s midpoint see Figure 4 3 When a geometry is rotated it rotates around one of its axes that run through the origin of the local coordinate system al
105. so illustrated in Figure 4 3 Thus a plain rotation only rotates the geometry around its midpoint which can be quite limited The requirements specified that it must be possible to rotate a geometry in any chosen point This is achieved by the following procedure 1 The first thing that has to be done is to translate the geometry so that the point of rotation marked with an X in Figure 4 3 a is located at the origin of the local coordinate system This is illustrated in Figure 4 3 b 2 The next step is to perform the actual rotation Figure 4 3 c 3 Finally the geometry is translated back to its original position i e the inverse translation of step one is performed The final result is illustrated in Figure 4 3 d Since all modifications to geometries in WTK are performed before a scene is rendered in each program loop the sequence above only displays the final result This means that it does not show on the screen the results of the intermediate steps 14 a b c d Figure 4 3 Rotation in a specific point Please note that the pictures shown in Figure 4 3 are screenshots from different angles That is why the axes are located differently 4 1 5 Different levels of immersion There are three different modes of stereographic viewing and WTK supports them all The different modes are Field Sequential Mode Over Under Mode and Interlaced Mode In field sequential mode the two images one for the left ey
106. t DeleteChild theLocation rockOn TRUE separateNode whole H_Vagga20 HEAD if NULL theParent WtGroup theParent DeleteChild theLocation rockOn TRUE separateNode whole M Vagga37 HEAD if NULL theParent WtGroup theParent DeleteChild theLocation radar new WtMovSep head radar SetName Radar rockOn TRUE separateNode whole o2621 RADAR if NULL theParent WtGroup theParent DeleteChild theLocation rockOn TRUE separateNode whole o4238 RADAR if NULL theParent WtGroup theParent DeleteChild theLocation Screen new WtMovSep radar screen gt SetName RadarScreen rockOn TRUE separateNode whole d522 SCREEN if NULL theParent WtGroup theParent DeleteChild theLocation rockOn TRUE separateNode whole d1539 SCREEN if NULL theParent WtGroup theParent DeleteChild theLocation head gt GetExtents headExt pole GetExtents poleExt screen gt GetExtents screenExt WtMovable head gt GetTransform headTrans WtMovable pole gt GetTransform poleTrans WtMovable radar gt GetTransform radarTrans WtMovable screen gt GetTransform screenTrans Separates and converts the base of the missile turrets HHBamse separateTop top new WtMovSep WtGroup whole top SetName Top rockOn TRUE separateNode whole o2511 TOP if N
107. t according to the transformations along both the X and the Y axes that the mouse handler reports x void HHVirtualManual rotateViewport float radians WtP3 geoMid oldPos newPos float radius angle refAngle geoMid myGeometry gt getMidpoint myView gt GetPosition oldPos oldPos geoMid radius sqrtf oldPos 0 oldPos 0 oldPos 2 oldPos 2 angle acosf oldPos 0 radius refAngle asinf oldPos 2 radius if 0 gt refAngle angle 1 angle radians newPos 0 radius cosf angle newPos 1 oldPos 1 newPos 2 radius sinf angle newPos geoMid myView gt SetPosition newPos myView gt AlignAxis Z geoMid newPos Zooms the viewpoint in and out of the 3D scene i e zooms along the z axis The degree of zooming is specified with transz x void HHVirtualManual zoomViewport float transZ WtP3 newPos newPos 0 0 0 newPos 1 0 0 newPos 2 float 1 transZ myView gt Translate newPos WTFRAME WORLD Fits the complete scene in the window 3 void HHVirtualManual completeScene myWindow ZoomViewPoint Tells the HHBamse geometry to rotate the radar part specifies which part of the radar that shall be rotated and positive specifies if the rotation is positive or negative 2 void HHVirtualManual radar int part int positive float rot if 6 part rot float positive 2 5 PI 180 else rot
108. t och stora manovrerbarhet win gt Draw2DText 0 01f 0 77f f r sin rackvidd win Draw2DText 0 01f 0 73f h geffektiva stridsdel initieras av win Draw2DText 0 01f 0 71f integrerade allv derszonroret eller vid win Draw2DText 0 01f 0 69f anslagsr r Den kombinerade effekten win Draw2DText 0 01f 0 67f tryckverkan har effekt mot alla typer win Draw2DText 0 01f 0 65f fr n sm snabba m l som t ex win Draw2DText 0 01f 0 63f attackrobotar eller kryssnings win Draw2DText 0 01f 0 61f stora l ngsamma m l som t ex win Draw2DText 0 01f 0 59f break case BAMSE POLE win Draw2DText 0 01f 0 95f win gt Draw2DText 0 01f 0 94f Ss s d win Draw2DText 0 01f 0 91f IRV kamera IK igenk nnings win Draw2DText 0 01f 0 89f v dersensor r monterade p en win gt Draw2DText 0 01f 0 87f plattform p toppen av en hoj och win gt Draw2DText 0 01f 0 85f mast Roboten styrs i banan av win gt Draw2DText 0 01f 0 83f eldledningsradar som r en vidareutveckling av win gt Draw2DText 0 01f 0 81f radar och som arbetar p Ka win gt Draw2DText 0 01f 0 79f GHz break 58 Eldledningsradar utrustning och gyrostabiliserad s nkbar 8 meters en Ericssons Eagle bandet dvs 34 35 case SPECIFIKATION robot s hojdt ckning robot den effektiva den effektiva meter
109. t the HHBamse geometry class LA class HHGeometry public virtual FLAG addAsChild WtGroup parent 0 66 virtual void rotate int axis float radians PI 180 0 virtual void rotate const float amp transX const float amp transY int part 0 virtual void chkNode WtNodePath nodePath 0 virtual WtP3 getMidpoint 0 virtual void nullAll BOOL justOrient 0 virtual BOOL shoot int whichOne 0 private virtual void loadGeometry 0 virtual void destroyGeometry 0 fendif C 6 The HHRotation classes VSA AAAA AAAA LAAI ATTA IAAI AAAA AAAI LALA AAAI AALA AA ANALA ALA LAAN AALALA ALAALA ALAALA AAAA AA AAAA ALAALA AAT TT HHRotation h The test geometry 1 L LL ifndef HH ROTATION H define HH ROTATION H include lt math h gt include HHGeometry h The first of the HHRotation classes which loads a simple geometry from two different different files This class is used to test the functionality of WTK ny class HHRotation public HHGeometry public m HRotation HHRotation 2 FLAG addAsChild WtGroup parent void rotate int axis float radians PI 180 void rotate const float amp transX const float amp transY int part void chkNode WtNodePath nodePath WtP3 getMidpoint static void HHRotationTask void myRotation private void loadGeometry void destroyGeometry void turretRotation float angle Geometry v
110. tate BAMSE SPEC break case BAMSE SPEC HHVirtualManual myApp gt setManState BAMSE WHOLE break S EEK Kk k k k k k k k k k k k k k k k k k k k k k k k k k k kok kok kok k k k k k k k kok kok k kok k k kok kkk kk kk k k kk k kk k kk kk kk I PRIVATE METHODS ERKI SE E K K kok kok kok k ko k k kok kok k k k k k kk k k kok k kk k kk kk k k k kk k k k k k k k k k k k k kk k k k k k kk k k k k k k kkk kk kk kkk kkk kkk Displays a simple welcome message in the console window and loads the splash screen to the render window xr void HHVirtualManual displaySplash WImessage n nWelcome to the BAMSE test session of World ToolKit n Wimessade 2 5 2445 33355 SS SS a Se ee esa n WImessage Written by Henrik Hedlund n n n myWindow gt LoadImage bamse tga 1 0 TRUE FALSE for unsigned int i 0 i 200000000 i No wait method worked with WTK and all keyboard events must be read from the console window since the Universe isn t activated yet Tells the mouse handler that it should check the mouse This method is used by the HHActionFn at every program loop 7 void HHVirtualManual updateMHandler myMHandler gt examineMouse 61 Resets the viewpoint to the starting point EA void HHVirtualManual resetViewport myView gt SetPosition origPos myView gt SetOrientation origOrient Rotates the viewpoin
111. tation gt screenAngle delete HHBamse myRotation gt screenTask HHBamse myRotation gt screenTask NULL BR kok k kok k kok k oko k ko kok kok k kok k RR k ko kok kok kok k kok k k kok kok kok k kok k k kok kok kk k kk k k kk k k kk k kk kk kk I PRIVATE METHODS kok k k kok kok k ko kk Ck ko kk Ck Ck kk k kok k k kk Ck ko kk k kk kok kk Ck k k Ck k kok k k kk Ck kk k kk k kk k kk k kk k kk k kk kk ke kk ko ke ke ek Loads all the geometry used by the instance and rotates it 180 degrees to compensate for the fact that VRML 1 0 has an inverse coordinate system compared to WTK oh void HHBamse loadGeometry float trans 3 2 2 0 WtP3 turretTrans trans whole MovNodeLoad xxxxBamse wrl 1 f whole gt SetName Whole computeTurrets computePole separateTop theParent NULL WtMovable whole gt MovAxisRotation Z PI WtMovable whole gt GetTransform wholeTrans loadMissile Destroys the geometry that previously have been loaded PRECON The geometry must have been loaded using loadGeometry Pil 84 void HHBamse destroyGeometry delete whole delete turret Rotates the HHBamse instance s turret geometry the given angle in radians around a point at the base of the missile turret Kof void HHBamse turretRotation float angle int part WtP3 translation if 1 part translation 0 leftExt
112. tener newListener HHMouseHandler void examineMouse void setListener HHListener newListener private WtMouse myMouse HHListener myListener int lastX lastY FLAG leftClicked middleClicked rightClicked fendif UT LT TL TL TL TL TT LT T L TTL HHMouseHandler cpp The mouse handler UT TTL TL T LT LTL TT L TT include HHMouseHandler h The default constructor Creates a new mouse device and resets all necessary 64 variables EA HHMouseHandler HHMouseHandler myMouse myListener new WtMouse NULL leftClicked middleClicked rightClicked FALSE FALSE FALSE A constructor where the listener HHListener is registered directly at the instantiation xy HHMouseHandler HHMouseHandler HHListener newListener myMouse new WtMouse setListener newListener leftClicked FALSE middleClicked FALSE rightClicked FALSE The destructor Deallocates the memory used by the instance Ef HHMouseHandler HHMouseHandler delete myMouse that shall listen to the mouse handler HHScreamer RC void HH Registers the class HHListener MouseHandler setListener HHListener newListener myListener newListener Examines the mouse and collects all the raw data and analyzes it The information is stored in a HHMouseData struct If there is any interesting information collected this struct is sent to the listener a
113. tents 0 WtMovable turret gt MovAxisRotation Z angle translation 0 1 translation 1 1 WtMovable turret gt Translate translation WTFRAME LOCAL Separates the turret sub geometry from the other makes it to a movable node and finally puts it back at the same place in the scene graph Kip void HHRotation2 separateTurret WtNode currentNode if rockOn char name currentNode gt GetName if NULL name amp amp 0 strcmp name Turret WtNode parent currentNode gt GetParent 0 if NULL parent WTmessage Unable to trace turret n else int childNum WtGroup parent gt NumChildren for int i 0 i lt childNum i if WtGroup parent gt GetChild i currentNode break WtGroup newTurret new WtMovSep NULL newTurret AddChild currentNode WtGroup parent InsertChild newTurret i WtGroup parent DeleteChild i 1 currentNode SetName TurretGeo newTurret gt SetName Turret turret newTurret rockOn FALSE else int children WtGroup currentNode NumChildren if 0 children for int i 0 i lt children i separateTurret WtGroup currentNode GetChild i UT TL TTL T TL TL L TTL TTL TT HHRotation97 h The test geometry adapted for VRML 2 0 VRML 97 UM T T LT T L TTL L TL T TT L TT T ifndef _ HH ROTATION 97 H define HH ROTATION 97 H include lt math
114. tes the geometry zooms the viewpoint in and out shoots missiles operates the radar on the geometry and changes the manual state aa void HHVirtualManual HHDemoTask void myApp HHGeometry temp if HHVirtualManual myApp gt demoOn delete HHVirtualManual myApp demoTask HHVirtualManual myApp demoTask NULL else temp HHVirtualManual myApp myGeometry temp rotate 0 f 1 f 0 if HHVirtualManual myApp countUp HHVirtualManual myApp gt viewPortCount if HHVirtualManual myApp viewPortCount gt 100 HHVirtualManual myApp countUp FALSE else HHVirtualManual myApp zoomViewport 2 f else HHVirtualManual myApp viewPortCount if HHVirtualManual myApp viewPortCount lt 400 HHVirtualManual myApp countUp TRUE else HHVirtualManual myApp zoomViewport 2 f if HHVirtualManual myApp gt radarUp HHVirtualManual myApp gt radarCount if HHVirtualManual myApp gt radarCount gt 30 HHVirtualManual myApp gt radarUp FALSE else temp gt rotate PI 180 O f 7 else HHVirtualManual myApp radarCount if HHVirtualManual myApp radarCount lt 0 HHVirtualManual myApp radarUp TRUE else temp rotate PI 180 O f 7 if HHVirtualManual myApp gt headUp HHVirtualManual myApp gt headCount if HHVirtualManual myApp gt headCount
115. than this VRML does not seem to have much to offer to SAAB Bofors Dynamics especially not since VRML s future is quite uncertain VRML has not changed much since SGI decided to stop financing it in 1998 and the format is in dire need of a enhancement VRML files are usually rather large in size and therefore not suitable to download especially when using a slow connection Other competing formats are starting to show up for example Cult3D and perhaps one of these will become a new standard for Internet 3D graphics Some day perhaps one of these new formats will have something to offer SAAB Bofors Dynamics VRML is truly not a suitable development environment for VR applications unless it undergoes guite a few radical changes in the near future Level of abstraction Adequate Connection to I DEAS Adeguate Hierarchical transformation Adequate Rotation in any chosen point Adequate Different levels of immersion Poor Table 4 8 VRML conclusion 4 6 VR Juggler VR Juggler is an application framework and set of C classes for writing virtual reality applications It is designed to allow the developer direct access to various graphics APIs for maximum control over applications while still providing a generalized easy to understand view of displays as well as input and output devices The above is cited from VR Juggler A Framework for Virtual Reality Development 11 and narrates what VR JUGGLER is VR JUGG
116. thoring Interface EAT is an interface specification that allows an external program to communicate with a VRML scene 9 EAI which is integrated in VRML 2 0 is currently only available for Java EAI for Java functions as a set of classes whose methods can be called to control a VRML world An applet written in Java can for example ask a VRML scene through the EAI for a specific geometry and then change the geometry s properties such as color translation or rotation VRML in itself has support for JavaScript to add behavior to the 3D worlds but through EAI whole applications can be built around a VRML worlds making it much more interesting for more advanced uses 4 5 2 Cortona SDK The CORTONA SDK is based on the same principles as EAI and provides a developer with an API that enables communication between an application written in either C C Visual Basic or Delphi and a VRML world The CORTONA SDK also allows for scripting within HTML pages in both JavaScript and Visual Basic script 10 It has proven to be difficult to acquire any real information about the CORTONA SDK other than ordinary advertisements Therefore we have been unable to form any opinion regarding its functionality 4 5 3 Cosmo Worlds From the beginning VRML was developed by SGI and COSMO WORLDS was the number one VRML editing tool available COSMO WORLDS had all the features that could be expected from such an editor and could be of most use to SAAB Bofors Dyn
117. to be provided by some other API for example SGI s OPENGL multi platform or Microsoft s DIRECT3D Win32 only This also means that VR JUGGLER can be combined with any of the aforementioned SDKs to enhance their support for VR hardware which can prove to be of most value The fact that VR JUGGLER is a free and open source API is also a very positive aspect and provides a developer with the possibility to change the functionality of VR JUGGLER to a certain project s needs Given that VR JUGGLER only fulfills the requirement described in 3 2 5 different levels of immersion there is no need to further evaluate this API From a developer s viewpoint VR JUGGLER should be considered to be a possible and valuable extension to another API or SDK that handles the graphical operations Level of abstraction Excellent Connection to I DEAS Hierarchical transformation Rotation in any chosen point Different levels of immersion Excellent Table 4 9 VR Juggler conclusion 4 7 Other development environments The development environments being evaluated are not the only ones available on the market Obviously there are more than those covered in this project Examples of other VR development environments include DVISE ALICE AVOCADO the CAVE LIBRARY and LIGHTNING The following information is fetched from Software Tools for Virtual Reality Application Development by Allen Bierbaum and Chrisopher Just 4 30 DVIS
118. tten in C careful design of developed applications may permit extensive re use of code in later applications which reduces the amount of development work involved When scene graphs have been created using COSMO 3D a developer can use the OPENGL OPTIMIZER API to improve the performance of an application OPENGL OPTIMIZER is also available from SGI and the two APIs are closely intertwined making them a full development package for high quality 3D applications Neither COSMO 3D nor OPENGL OPTIMIZER is a development environment for VR applications Both lack support for higher levels of immersion This is not necessarily a problem due to the fact that COSMO 3D is almost perfect for use with VR JUGGLER an API for development of VR applications that has no support of its own for graphical operations VR JUGGLER is discussed further in section 4 6 4 3 1 Level of abstraction As mentioned earlier COSMO 3D has a slightly lower level of abstraction than WTK or VTREE but there seems to be no significant difference The level of the graphical programming is just slightly lower than WTK and about the same as VTREE The scene graph representation is built on the same structure as both WTK and VTREE but the major difference between COSMO 3D and WTK or VTREE is that both WTK and VTREE are more of complete packages and provide more support for VR hardware A solution to this problem is discussed in paragraph 4 3 5 below 4 3 2 Connection to I DEAS C
119. urpose providing an advanced scene graph structure that allows features such as stereographic viewing and other necessities for VR implementation The combination of COSMO3D and VR JUGGLER provides a developer with a development environment that is as complete as WTK or VTREE The only difference is that COSMO3D has a slightly lower level of abstraction and offers fewer features in form of special effects an area that currently is under development at SAAB Bofors Dynamics see Anders Aslund s thesis Special Effects in OpenGL 4 3 6 Conclusion COSMO3D and OPENGL OPTIMIZER combined with VR JUGGLER is a most powerful and flexible solution for creating 3D and VR applications That the combination is free of charge is perhaps not as important for a business of SAAB Bofors Dynamics size but it is worth mentioning Both COSMO3D and VR JUGGLER exist on several platforms both Windows NT and UNIX which can be important if the development is moved from Windows NT to UNIX these are the two main platforms in use at SAAB Bofors Dynamics 20 The major weak point of COSMO 3D 1s that special effects are missing in the package As mentioned earlier special effects is currently under development at SAAB Bofors Dynamics These are most likely to be created using OPENGL In that case there is nothing that prevents the usage of these special effects in COSMO 3D On the contrary COSMO 3D and OPENGL OPTIMIZER as the name suggests are built on top of OP
120. ws ANSI C which makes an object oriented approach more difficult and this can also be problematic when creating larger applications To sum things up REALAX is very user friendly and has a high level of abstraction This also makes it a limiting software to use The world oriented approach makes it less appropriate for applications with few objects and the absence of an object oriented API also makes it less appropriate for creating larger application at least if there should be programming involved 4 4 2 Connection to I DEAS REALAX Claims to have support for the following file formats 22 Import Export RXscene DXF 3D Studio ASCII IRIS Inventor 1 0 DXF Multigen flt OpenFIt15 4 TRIS Inventor MultiGen flt OpenFlt15 4 Nurb file SGI bin SGI Sgo SIG ydl ISTL STA VDAFS VRML 1 0 VRML 2 0 Wavefront obj Table 4 6 Realax import export formats VRML 2 0 is again the format of most interest It seems that REALAX suffers from the same problem as WTK i e it does not have full VRML 2 0 support The main suspect is still the PROTO node This problem cannot be solved by converting the VRML 2 0 file to a VRML 1 0 file since REALAX does not seem to be able to import a simple VRML 1 0 geometry with satisfying results An attempt has been made to import one of the simple VRML 1 0 geometries used in evaluating WTK This geometry consists of one cylinder one box and two cones but after
Download Pdf Manuals
Related Search
Related Contents
ダウンロード - ASL Caserta multi charger X2 400 日本語版マニュアル Neues in Edgecam 2015 R1 818DV Manual _df Breeze-3 et les meilleures adresses pour préparer et réussir week gefrierschrank Copyright © All rights reserved.
Failed to retrieve file