Building Interactive Virtual Environments
Building Interactive Virtual Environments
I (2005) %1-S70
phenomena. Computer based devices and software some years ago with the development of cheap
used in such training are often catted computer computer power and prevalence of the Internet.
simulators, although this is a very inexact term, Medicine has traditionally been one of the major
as it should cover everything from, for example, application fields for VR, with medical education
tens of thousands dollar worth patient simulators being the first area in which it made significant
capable of realistic gas exchange, blood flow and contributions. Others include remote and local
heart activity; over complex simulation devices surgery, surgery planning, treatment of phobias and
for surgical and endoscopic procedures; down to other causes of psychological distress, ski[[ training,
software-only models and study tools or small pain reduction, and more [5].
programs for visua[isation of pharmacokinetic On the other hand, one has to admit today
graphs, and more [2]. that VR in general has not quite lived up to
In genera[ two kinds of simulations should its initial expectations. Why don't we see more
be distinguished first: (a) 'real-world' simulated VR-based systems in our professional activities
situations, and (b) virtual environments (VEs) (not to mention daily lives) yet? While one
based on computer models and animations. With reason is certainly that VR hardware is still
both approaches, students should work through extremely expensive and immature, we be[[eve
predefined scenarios and training tasks, although that the main reason for such situation is the
involving a mentor to supervise such training is in lack of good software standards and their efficient
both cases necessary to provide higher complexity implementation on common computer platforms.
and realistic assessment. Practically only one such solution, Virtual Reality
A good example of training using simulated Modelling Language (VRML)[6], exists currently
exercises is the system of crisis management for building open standard applications. Most
training in neonatal resuscitation [3] introduced by VRML applications that have been built using this
L. Halamek, D.M. Gaba and their team at the open standard for Web VR are stilt mainly static
Veterans Affairs Palo Alto Health Care System [4]. visual[sat[on of 3D objects and perhaps some simple
It can provide a significant degree of immersion animations. While their educational value should, of
and a very realistic experience, but the price is course, not be underestimated, as many excellent
high: special training facilities with instruments, examples also in the field of medicine and biology
monitors, mannequins, and skilled senior staff to demonstrate[7], the fu[[ potential of VRML lies
control and supervise the training are necessary. further ahead.
A virtual environment atone can not completely In the past, we have carefully studied VRML
replace such experience, but it can help students and used it to create various virtual environments.
to be better prepared for such situations and thus Our challenge and aim has always been to make
make the whole process more efficient. The two them as dynamic and interactive as possible,
approaches are complementary - while certain skills because we believe the success of experience
(e.g. intubation, heart massage, etc.) can be better with virtual environment is strongly related to
trained with real equipment and mannequins, these two components. The culmination of our
others (for example assessment of vital signs) can efforts is a virtual delivery room [8], which we
be more realistically pictured using interactive designed to support training of proper procedures
3D graphics. We believe that modern medical in resuscitating newborns.
education should include all four mentioned stages This paper presents some aspects and [essons
of the [earning path, as shown in Fig. 1.
learned while implementing a dynamic 3D repre-
Let us now focus on applications of virtual reality
sentation of vital signs of a virtual newborn [9]
(VR) technology, which received a lot of attention
with VRML, and is organised as follows: after briefly
introducing a three-level scheme for implementing
1. Traditionallearning 4. Workingwith the dynamic interactive virtual environment in
(theory) patients the fol[owin8 section, we present the main
content in the third section, where we describe
Learning (a) the performance issue of the VRML T i m e S e n s o r
trainingand
in t ~ ?
simulated node and its solution, (b) the virtual newborn as the
conditions main object, and (c) the complete architecture of
\J 2. Computer I I our system for training in neonatal resuscitation.
I simulations I I sir~ In the last section some conclusions based on
our experiences are given together with a brief
Fig. 1. Learning and training in simulated conditions can dose announcement of the X3D standard, which will soon
the gap between theory and practice in medicine. replace and extend VRML.
Interactive virtual environments for simulated training in medicine using VRML and Java/JavaScript $63
Fig. 2. Example of a basic animation cycle - gradual change of the object's colour is initiated by clicking on an object, related to
T o u c h S e n s o r first. This then triggers the T i m e S e n s o r to start sending events to the C o l o r I n t e r p o l a t o r node, which sca[es
received values of the cycle fraction to an appropriate co[our space. The [Link] fields are dark, the e v e n t : I n fields are bright
grey and exposed fields are iridescent.
VRMLBrowser JavaVM
Scenegraph . . . . . .- ~ ~. . . . . EAI JavaApplication
CI VKIVlL~
/ Java
.... mat ~ %
S ~'~ VirtualReality~ge ~U[hOrfrmg GUI,model,
traningscenarios J
D
(<~ Scriptsand ~ ModelingLangua
~, ~plets VRMLSensors ~
//
an~)erp~)°rs ~ / / /
Fig. 3. Typicalapplication built with VRMLand Java runs within the Web browser.
Along with the actual value also the timestamp mentor interventions, conversation) during the
is received. The events generated by the Script training.
method have the same timestamp as the event
which triggered them to enable scheduling and
2.3. Implementation of complex behaviour over
synchronisation mechanisms, although a certain
all three levels
amount of time is needed to process the events on
a real system during execution. When creating complex interactive YEs, all
In our prototype training system we used scripting three implementation levels coupling VRML with
to implement representations of all vital signs (see Java/JavaScript (or other general purpose program-
the example for respiration in Section 0). ming language) have to be used. But, as usually in
programming, there is more than one possibility to
External programs - Level 2 (EAI) implement certain object behaviour. It is therefore
important to know about the possibilities and
Script programs (Level 1) are activated upon
limitations of each particular implementation level,
receiving events and, therefore, under control of
to be able to spread the design of our planned
the VRML browser. As result, they can significantly
system behaviour among them in the most efficient
decrease its rendering performance. Sometimes we
manner. A list of, in our view, main advantages
also need to implement extensive program logic as
and disadvantages of each level is summarised in
part of a complex VR application. To solve both
Table 1.
issues, we can connect an independent application
written in any program language with the VRML
browser using the External Authoring Interface 3. Results
(EAI) [15]. Although not officially part of the VRML
97 standard, it is supported by most browsers [16], 3.1. Performance control of Level O: Extension of
especially for Java [12]. the TimeSensor
If applications run independently of the VRML Implementation of the basic animation mechanism
browser multi-tasking/threading is managed by is left to the browser, which handles the described
the operating system. In the ideal case, users 'continuous' timer-to-interpolator and interpolator-
should thus have better control over allocation of to-node message passing (as in example of Fig. 2) in
processing time between rendering (VRML browser) its own way based on its own internal schedutin t.
and program logic (external program). However, But in practice not all animation cycles have the
because most practical applications involve Java same importance: in our application, for example,
where often even both VRML browser and Java we wish to assign high priority to animations related
Virtual Machine (JVM) run as plug-ins within the to the virtual baby and lower priority to some other,
HTML browser (Netscape or Internet Explorer) it is less important virtual objects. But even if priorities
difficult to treat each one as a separate process were available this would not solve the performance
(Fig. 3). issue completely. In our observation, the VRML
Most of the system functions not directly related browsers consume all available processor time
to 3D rendering are usually contained in external (100% CPU usage) even if only a simple animation
applications - in the case of our training system is predefined in the scene. This behaviour is caused
for neonatal resuscitation system (Section O) this by the true nature of 'continuous' message passing
includes the interface to a motion detecting device, as it is implemented in the browser: 'continuous'
multi-user audio conferencint, part of the user in this case means 'the highest possible frequency
interface (dialogs), control over training scenarios, of consecutive discrete events'. Quite an elegant
and storing of all data (student motion and actions, solution in the ideal case and on ideal computers,
Interactive virtual environments for simulated training in medicine using VRML and Java/JavaScript $65
Table 1
The main properties of levels for implementation of dynamic behaviour in VRML
but it causes a lot of troubles in a more complex function [in the Java Virtual Machine (JVM) within
real VRML application running on real machines and the Netscape Communicator we used] proved to be
in parallel to other programs. inadequate.
The solution of the animation performance Therefore we slightly adjusted the design and
problem lies at its core: the TimeSensor node. developed a second replacement for T i m e S e n s o r -
We know now that all its instances in the scene are Timer2. Here each instance has its own triggering
treated equal by the browser and there is no option thread. Although the opposite had been expected,
to either define their priorities or to bound the our tests have shown that there is tittle difference
frequencies with which they generate messages for in CPU toad between Timer and Timer2. However,
interpolators. Having these two serious limitations the ratio between the actual and demanded
in mind we decided to create a new implementation frequency of events proved (as shown in Fig. 4) to
of the T i m e S e n s o r node; we catted it T i m e r [17]. be much better in the case of Timer2. This proved
The Timer node is an instance of the S c r i p t node that (at least with the JVM used) multithreaded
and has almost exactly the same interface as the code with longer s l e e p ( ) delays is more efficient
original TimeSensor node, except for the extra (can exploit CPU better) than one single thread with
field d e l a y of type SFType. Its default value is shorter s l e e p ( ) delays.
set to 0.1 second (meaning ten triggered messages Performance tests showed that £PU toad can be
per second). significantly reduced using our Timer2 (and Timer)
The Timer node is written in Java language using
Timer Timer2
threads. Our idea at first was to join the triggering 1 I
TabLe 2
The interpretation and visualisations of different newborn's' vital signs. Crosses denote the corresponding LeveLs of
implementation
i~udioClip
y~
/
1/
/
\ Timer]
i,
event from
Java
r set Tracuon
Fig. 6. Schematic structure of the newborn's respiration mechanism implemented with VRMLnodes: B r e a t h ( Tn/Out ) C o o r d T n t e r p ,
and B r e a t h ( I n / O u t ) I n t e r p o l a t o r nodes move newborn's chest and respiration curve on the virtual monitor, respec-
tively; Breath(In/Out)Audio nodes replay audio clips of the real newborn breathing; Breath(In/Out)Length and
B r e a t h ( I n ~ O u t ) P a u s e nodes dictate the durations of the different respiration stages; B r e a t h L o o p e r node receives the
commands from the mentor's module and controls the variations of breathing frequency in time. Circles depict different nodes
with their names (italics) and types (bold), field types are coded in the same manner as in Fig. 3.
Student Mentor
application application
) modelofnewborn modelofnewborn
streamingaudio streamingaudio
nav,oat,on I'----
J ~/4"----~ (/"navigati°n'XX~ I~------~ navigation
Trackin~ device ¢ ~ - ~
Fig. 7. Architecture of the VIDERO prototype system for training in neonatal resuscitation.
• Navigation server constantly synchronises the kind of applications. Objects exist only as graphical
viewpoint of the mentor with the viewpoint of descriptions (surfaces); no mechanisms are implied
the student, who is in control of navigation in the to account for their weight, material, elasticity,
3D virtual world. This program also uses our own movement and other properties of the physical
Java Fastraklib library [20] to read data from the reality. Therefore also no relations among the
(optional) Po[hemus motion tracking device. objects can be investigated: within the generic
• Audio server is a program module which allows framework even collisions can only be detected
real-time audio conferencing between training between the avatar and the objects and not
participants [21]. among the objects themselves. All this can, of
• Storage server can be activated by the mentor course, be justified in terms of the (non-)existing
to record all events during the training. This computer power that such representation would
includes navigation (viewpoint changes), setting swallow - already rendering of somewhat more
of the newborn parameters, student actions, and complicated scenes hits the limits of currently
voice communication. available equipment.
• Replayer is separate program which allows the On the positive side, VRML offers many pos-
stored training session to be repeated in real time sibilities of interfacing to other programming
exactly as it was carried out. languages. Thus, most of the application logic can
The structure of the complete VIDERO system is be implemented separately in Java or C++ and the
schematically depicted in Fig. 7. VRML browser is used only as a rendering engine.
devices (motion tracking, data sampling, voice the mentor performs the correct procedures and
communication) etc. comments on his actions. Our VlDERO system can be
Some issues can partly be addressed by custom used for this kind of tutoring as well. The possibility
developments, like in our case where we developed to record a training session is another great option
a replacement for the T i m e S e n s o r node with to improve medical training. The mentor can repeat
the ability to specify the frequency of generated the session exactly as it was performed and call the
output messages in order to limit the CPU usage. attention of students to particular details that were
Preferably, such extensions should reside within the perhaps left unnoticed during the session.
basic VRMLspecification. The virtual baby alone can also be used as
a complement to simulated training involving
The future of VRML" Extensible 3D (X3D) real devices. If students are using a real baby
The Web 3D Consortium has proposed a draft of mannequin to practice some hands-on procedures,
the next generation X3D standard [22], which will the computer-generated avatar on a display next
bring closer XML, MPEG4 and VRML technologies. to them can be used to create a more realistic
It remains to be seen whether new features will impression of the simulated condition.
allow easier creation and better control of dynamic
virtual environments. The future of training using virtual environments
The current state of virtual reality technology
does not simply allow the setting up of various
4.2. New possibilities for medical training
training environments at moderate costs. Extremely
VlDERO system for neonatal resuscitation expensive, inefficient hardware and lack of higher
A computer-generated representation of a human level software standards put such training systems
being, a virtual newborn in our case, has one out of the domain of regular educational practice.
major advantage over the rubber doll, which is On the other hand, numerous advantages can be
traditionally used in neonatal resuscitation training: found in favour of such training, some of them also
several vital signs can be dynamically rendered by mentioned in this paper, and it seems that medicine
generating their visual and audio representation. in particular is an appropriate application field.
Students, working on an example case, are now Therefore we believe that virtual environments
faced with more a realistic challenge - instead and other derivatives of VR technology will find
of listening to a verbal description of the baby's their place as complementary training methods in
condition they have to continually assess visual medical education of the future.
and auditory clues from the baby itself and virtual
devices around it.
In our model of training a teacher (mentor)
References
remains the necessary key element: either he/she [1] S. Samothrakis, T.N. Arvanitis, A. Plataniotis, M.D.J. Mc-
directly controls all observable parameters (heart Neill, RF. Lister, WWW creates new interactive 3D graphics
rate, respiration rate, skin colour, facial expressions and collaborative environments for medical research and
education, Int. J. Med. Inform., 47(1-2) (1997) 69-73.
and movements) of the virtual baby or he/she [2] G. Meller, A typology of simulators for medical education,
predefines their trajectories over time by so-called J. Digital Imag., 10(3 Suppl. 1) (1997) 194-196.
scenarios. In our system, the scenarios are small [3] L.R Halamek, D.M. Kaegi, D.M. Gaba, Y.A. Sowb,
sets of parameter changes in a specific period of B.C. Smith, B.E. Smith, S.K. Howard, Time for a new
time, and can be activated during a training session paradigm in pediatric medical education: Teaching neonatal
resuscitation in a simulated delivery room environment.
according to the actions the student chooses. Pediatrics, 106(4) (2000) 106 110.
Lists of possible actions and their corresponding [4] L.R Halamek, Development of a Simulated Delivery Room,
parameters are again described in advance by the presented at 7th Annual Medicine Meets Virtual Reality Conf.
mentor. In this way the mentor, although physically (MMVR 1999), January 20 23, 1999, San Francisco, CA.
separated from the student, is still the one fully in [5] J.A. Waterworth. Virtual Reality in Medicine: A Survey
of the State of the Art. Online resource at [Link]
charge of the training process. This was the set-up [Link]/~jwworth/[Link] (July 1999).
we have chosen for our current prototype together [6] The VRML Specifications, [Link]
with medical experts. Here the student is on his/her specifications/vrml/ISO-IEC-14772-VRML97/
own, while the mentor is a more or less hidden, [7] T. Amon, V. Valencic. VRML enhanced learning in biology
silent manipulator. and medicine, Fut. Generation Comput. Syst., 17(1) (2000)
1-6.
[8] D. Koro~ec, A. Holobar, M. Divjak, D. Zazula. Dynamic
Other training modes VRML for simulated training in medicine, in: Proc. 15th
But the roles could also be reversed - the IEEE Symp. on Computer-based Medical Systems, Maribor,
student would observe the mentor at work, while Slovenia (2002) pp. 205-210.
S70 D. Koro~ec et a[.
[9] M. Divjak, A. Holobar, I. Prelog. VIDERO - virtual delivery [16] EAI design notes, [Link]
room. in: Proc. Int. Conf. on Trends in Communications, IEEE [Link]
Region 8 Student Paper Contest, Bratislava (2001) Vol. I, [17] A. Holobar, D. Zazula. Improved control of events in the
pp. LIV-LVII. VRML 2.0 application, in: Proc. 6th Euromedia Conf.,
[10] R. Carey, G. Bell. The Annotated VRML2.0 Reference Manual Valencia, Spain (2001) pp. 67-71.
(Addison-Wesley, Berkeley, CA, 1997). [18] R.S. Bloom, C. Cropley, et al. AHA/AAP Neonatal
[11] A.L. Ames, D.R. Nadeau, J.L. Moreland. VRML Sourcebook Resuscitation Textbook (American Heart Association,
(Wiley, New York, 1996). 1994).
[12] The Virtual Reality Modeling Language: Java scripting ref- [19] Java Remote Method Invocation, [Link]
erence, [Link] products/jdk/rmi/
ISO-IEC-14772-VRML97/partl/[Link] [20] I. Prelog, D. Zazula, D. Koro~ec. Navigation inside virtual
[13] The Virtual Reality Modeling Language: JavaScript script- environments using Polhemus 3Space Fastrak tracking
ing reference, [Link] device, in: Proc. 9th Electrotechnical and Computer Science
vrml/ISO-IEC-14772-VRML97/part1/[Link] Conf. ERK 2000, Portoro~_,S[ovenia (2000) pp. 91-94.
[14] J. Hartman, J. Wernecke. The VRML Handbook: Buitdin~ [21] M. Divjak, D. Kor~e. Visual and audio communication
moving worlds on the web (Addison-Wesley, New York, between visitors of virtual worlds, WSESInt. Conf. on Neural
1996). Network and Applications, Puerto de la Cruz, Canary Islands,
[15] C. Marrin, Proposa[for a VRML2.0 Informative Annex: Exter- Spain (2001) pp. 41-46.
nal Authoring Interface Reference, [Link] [22] X3D - Extensible 3D, http: //[Link]/x3d/
WorkingGroups/vrm[-eai/[Link] (Novem-
ber 1997).