<<

Optical tracking for QAVE, a CAVE-like System DomagojBaričević,HrvojeDujmić,MatkoŠarić,Ivanðapić UniversityofSplit,FESB Split,Croatia [email protected],[email protected],[email protected],[email protected] thedisplaysareproperlyaligned,andiftheperspectiveofthe Abstract: In this paper we present the optical tracking system for the QAVE (Quake + CAVE) system that we developed based imageshownisproperlyadjustedastheusermovesaround, on the computer game Quake III Arena. The QAVE system is theimmersionwillbecomplete. an immersive CAVE-like virtual reality system based on the The name CAVE is a registered trademark and can open source 3 (formerly known as the technicallyonlybeusedforsystemsthatarelicensed;thisis Quake 3 engine) and the open source computer library why the term “CAVElike system” is often used when OpenCV. The QAVE features an optical tracking system that utilizes two cameras and two color markers (one for the head, discussingthesetypesofsystemsingeneral. one for the hand). The use of open source software and optical AninterestingexampleofaCAVElikesystemisCaveUT, tracking makes the system very cost-effective. The QAVE developedbyJeffreyJacobsonandhiscollaborators[2],[3]. system demonstrates that computer games are a viable platform CaveUT is based on Epic Games' computer game Unreal for scientific research, especially in the development of virtual Tournament and uses Unreal Tournament’s builtin support reality applications. forgamemodificationstocreateaCAVElikesystem. This paper presents a gamebased CAVElike system 1. INTRODUCTION basedonidSoftware’s“idTech3”engine(formerlyknown as the “Quake 3” engine), one of the most widely used In recent years games have been increasingly used for enginestodate.Thefirstgamepoweredbytheengine was scientific purposes. Games are, by nature, flexible so with QuakeIIIArena,adirectcompetitortoUnrealTournament. somesmallchangestheycanbeeasilyputtootheruses.At In August of 2005 its source code was released under the thecoreofagameiswhatisknownasthe“gameengine”, GPL license and so became available to everyone and thesoftwaretechnologythatpowersagame.Anythingthatis enabled many applications including our system, the specific to a particular game such as textures, models, “QAVE”. sounds, music, video, levels, scripts etc. is not part of the Oursystem,QAVE(Quake+CAVE)isthefirstCAVE engine. This means that you can have two very different like system powered by the Quake III engine. There is gamesthatarebuiltusingthesameengine.Oneofthemost another system that combines CAVEs and Quake, Paul obvioususesforgameenginesisinthefieldofvirtualreality Rajlich’sCaveQuake[4].Howeveroursystem(QAVE)and sincegamesarebytheirnaturevirtualenvironments. CaveQuakearediametricallyopposed:CaveQuakeenablesa Virtual Reality (VR) is a field that has long interested regularCAVEsystemtoplaytheQuakegame;ontheother scientists, engineers, artists and the general public. Virtual hand QAVE uses the Quake game to create a CAVElike realityhasmanyapplications;itisusedinengineeringtohelp system. visualizedata,simulatecomplexmechanisms,andsoon.Itis also used in entertainment, medicine (imaging, surgery), training (pilots, astronauts), psychological therapy (phobias, 2. GAMES IN DEVELOPMENT OF VR SYSTEMS posttraumaticstress),etc. Themaingoalofvirtualrealityistoimmerseahumaninto Gamesareofinterestinresearchbecausetheycanprovide a virtual world. Some of the most immersive systems inexpensive, fast, well rendered, interactive virtual worlds developed to date are the CAVElike systems, named after with realistic physics models. They often have free the first such system developed by the Electronic development tools that can be used to create game content Visualization Laboratory at the University of Illinois at (player models, game maps, etc.) and also to modify the ChicagoanddemonstratedatSIGGRAPH92[1].TheCAVE game.Giventhatthegamingindustryisamultibilliondollar (CAVEAutomaticVirtualEnvironment)isbasicallyasmall business,gameswillonlygetevenmoreadvanced,therefore roomwherethewalls,thefloorandtheceilingarecomputer evenbetterplatformsforresearch[5],[6]. displays.Eachofthesedisplaysshowstheviewofthevirtual The games most often used in research today are either environmentthatcanbeseenfromthepositionoftheuser’s part of the Quake series or Unreal series of games. These avatar. If the user’s position changes the displays have to gamesbelongtotheFirstPersonShooter(FPS)genre.AFPS changetheirviewsoitcorrespondstothenewperspective.If isatypeofactiongamewitha3Dworldviewedfrom the limited. On the other hand Quake III Arena is completely player'sperspective.AlthoughthefirstFPSgames onlyhad opensourcesowehaveabsolutefreedomtomodifythecode thefirstpersonview(hencethename),modernFPS games andadjustittoourneeds.Howeverthisadvantageisalsoits havenosuchrestriction. drawback.CaveUTisbuiltasaregularmodificationofUT Modern FPS games are based on the clientserver andthereforeitcanbe(andhasbeen)easilyupgradedtonew architecture.Althoughit’sactuallyoneprogram,thegameis versions.Ontheotherhand,theQAVEsystemhaschanged logicallysplitintotwoparts.Theserverrunsthesimulation, partsofthegamethatwerenotinitiallymodifiable,because while theclient providesauserinterface.One of the main ofthatitcan'tbeeasilyupgradedtonewversions. reasonsforthisseparationissupportformultipleplayers. ThemultiplayermodeofFPSgamesisthekeytocreating a CAVElike system. The Quake and Unreal games (like 3. QAVE OVERVIEW most multiplayer FPS games) offer a spectator mode in which players in a multiplayer game can just observe the QAVEisaCAVElikesystemthatusesamodifiedversion actionwithoutparticipatinginit.Thespectatormodecanbe of id Software's Quake III Arena computer game as its used in free floating mode where the players can fly the graphicsandphysicsengine.Thesystemallowsforrealtime camerathroughtheworld,orinfollow modeinwhich the active perspective correction using an optical tracking spectatorfollowsoneoftheplayersinthegameandseesthe system, allows for up to 30 individual screens, and has world from his/her perspective. This mode is what is used supportfordatagloves.Headpositionisusedforperspective when creating the multiscreen display of a CAVElike correction.Handgesturesintandemwiththerelativeposition system. of the hand in relation to the head are used to control movementinsidethevirtualenvironment. In a QAVE (or CaveUT) system there is one computer assigned to each screen of the display, there is also a computer assigned to the user. Each computer runs an instanceofthegame,onecomputer(usuallytheuser's)starts a multiplayer game and acts as the server and the other computersconnectasclients.The game instancecontrolled bytheuserrepresentstheuser'savatar;theclientsallswitch to spectator mode and select the avatar as the player to follow.Sofarallthiscanbeaccomplishedwithnochanges to the game and at this point all the screens would be showing the same view. However by making some modificationtothegametheviewscanberotatedsothat,for example,inathreewallCAVE,oneviewislookingforward, oneisrotated 90 degreesleft,anthelast oneis rotated 90 degreestotheright. TobefullyimmersiveaCAVElikesystemmustmaintain the proper perspective for all of the different parts of the display. Simply rotating the view will only provide proper perspectiveiftheuserisintheverymiddleofthedisplay.To allowforcorrectperspectivefromotherpositionsCAVElike systemshavetoprovideperspectivecorrection.Theposition ofthe player hasto be known ordeterminedandthe view frustum(theportionoftheworldthatisrendered)hastobe adjustedaccordingly.Thisbasicallyturnsastaticscreeninto anactivewindowintothevirtualworld. InCaveUTadjustingthefrustumisdonebyusingalibrary (VRGL)thatactsasanintermediarybetweenthegameand the OpenGL library, in QAVE the game itself has been modifiedtoallowperspectivecorrection. QAVEandCaveUTsharemanyofthesametraits,most notablythelowcost;howeveroursystem(QAVE)has one major advantage over CaveUT. Unreal Tournament is only partially open source so the ability to change the game is Figure 1 - Construction used during development Figure 1 shows the construction used during QAVE’s of the QAVE user. QDC then calculates the perspective development.ThephysicalandlogicalstructureoftheQAVE correctionandpassestheresultstotheQAVEArena (QA) systemisshowninFigure2. doingtherenderingforthatscreen,theQAthenadjuststhe TheQAVEsystemiscomprisedofthreeprograms:QAVE rendering of the image for its screen. The corrections are ControlCenter,QAVEDisplayControllerandQAVEArena. fieldofviewanglesforfourdirections(up,down,left,and right)andaresenttothescreen’sQA. As the name implies, the QAVE Control Center (QCC) controls the functioning of the QAVE, more precisely it QAVE Arena (QA), a modified version of Quake III acceptsandinterpretsgesturesfromtheuser'sdatagloveand Arena,isthehartoftheQAVEsystem.Itrunsthesimulation, alsoperformsmotiontracking.QCCistheonlypart ofthe rendersthevirtualenvironmentandevenallowsconnections QAVEsystemthatisdirectlycontrolledbytheoperatorand betweenmultipleQAVEs.Therearethreerolesthatmaybe the user. The user interacts with QCC (and therefore the playedbyQA,runninginanumberofinstancesondifferent QAVE system) by means of a dataglove and the tracking computers.ThefirstroleofQAVEArenaistheuser’savatar system.Currently,QCCsupports5DTdataglovesbutitcan and deals with the actual actions within the virtual easily be reprogrammed to use other datagloves or other environment; the second role is the QAVE display, these typesofinputdevices.TheQCC’strackingsystemusesthe QAsareinchargeoftherendering;thethirdroleistherole OpenCVcomputervisionlibrary[7], oftheserverthatactuallycreatesthevirtualenvironment. The QAVE Display Controller (QDC) acts as an Usuallytheuser’sQAwillalsoactastheserverandthe intermediarybetweenQCCandQAandistheprogramthat displayQAswillbetheclientsbutthisisnotnecessary.Any performs the calculations necessary for perspective instanceofQAcanbeaserver,eventhosethatarenotpartof correction.Itwascreatedtominimizethechangesdonetothe theQAVEsystemitself,thismeansthatsomebodyinsidea codeofthegameitself.EveryscreenhasaninstanceofQDC QAVEsystemcanconnecttoanyQAanywhereintheworld. pairedwiththatscreen’sQA.Bothprogramsrunonthesame FurthermorethisallowsseveraldifferentQAVEsystems to computer.Sinceeachinstance ofQDCisassignedits own be connected to each other so that different people from screenithastobeconfiguredwiththescreen’sposition, acrosstheworldcanbeinthesamevirtualenvironment. QDC receives messages from the QCC via a network QA is controlled by messages received from the QAVE connection.Oneofthesemessagescontainstheheadposition ControlCenterandtheQAVEDisplayController.

QAVE Arena (screen)

QAVE Display Controller

QAVE user

QAVE Arena (server)

QAVE operator

LAN QAVE Control Center QAVE Arena (user)

LAN/Internet Figure 2 - QAVE logical and physical diagram QuakeIIIArenahaswhatareknownasconsolevariables. The QAVE's tracking system uses the open source Theconsoleisusedbyplayerstochangethegame'ssettings OpenCVlibraryoriginallydevelopedbyIntel[7].Thelibrary and status while it is running; this is done by issuing implements several computer vision algorithms including commands and setting variables. QAVE Arena has defined manytrackingalgorithms;theoneusedbytheQAVEisthe severalconsolevariablesinadditiontothoseitinheritedfrom CAMSHIFT(ContinuouslyAdaptive MeanShift)algorithm Quake III Arena. Some of these variables are used to [8].IntheQAVEsystemtheobjecttotrackisdeterminedby configureQAwiththe orientation ofthescreen; others are its histogram. The histogram is specified by the QAVE usedtoadjusttheperspectivecorrection,torotatethewhole operatorselectingtheobject(headandhandinourcase)on display when necessary and so on. The configuration theimagecapturedbythecamera. variablesaresetbytheoperatormanuallybutthe variables Aftertheheadandhandhavebeenfoundonthecamera forperspectivecorrection,displayrotation,headpositionand imageitisnecessarytocalculatetheirrealworldpositions. relative hand position are set by QA automatically when it QCC is configured with the cameras’ position, orientation getsamessagefromQDCspecifyingthenewvalues. andfieldofview.Thesystemknowsthelocationofthehead and hand in the image coordinates. To determine the real world(3D)coordinatesafairlysimplegeometriccalculation 4. QAVE MESSAGES isperformed. Objectpositionsaredeterminedinthefollowingway.The The QAVE system is made up of multiple components CAMSHIFTalgorithmletsusknowwheretheobjectappears whichneedtoworktogether,thisisaccomplishedbypassing tobefromtheperspectiveofthecamera.Sincewealsoknow messages.ThedifferentQAVEArenainstancescommunicate thepositionandorientationofthecameraitisfairlysimpleto witheach otherto maintainthe virtualworldlike any FPS determinealinethatstartsatthecameraandpassesthrough anduseinternalsystemsinheritedfromQuakeIIIArena;they the object. Now we have two lines in space, one for each alsoacceptmessagessentbyQCCandQDCthatareunique camera,andtheselinescrosswheretheobjectis,sotogetthe to the QAVE system. The QAVE messages are either positionoftheobjectweneedtofindtheintersectionofthe windows messages that are used to send information from lines. Normally, the lines we get will not actually be QCCorQDCtotheQAtheycontrol(andthereforerunning intersecting;instead,theywillpassveryneareachother.This on the same computer), or they are network broadcast is not a problem since the method we use to find the messages(UDPdatagrams)thataresentfromQCCtoQDC. intersectionactuallyfindstheshortestlinesegmentbetween AlthoughQCCandaninstanceofQDCcanberunning on the lines. The segment is defined by its end points; we thesamecomputertheystillcommunicateviaUDP.Theflow considerthe objectto bepositionedattheaverage of these of messages is one way, QCC only sends messages, QDC twopoints,thelengthofthesegmentcanbeanindicatorof sendsandreceivesbutonlyinonedirection:fromQCCand howprecisethepositionis,theshortertheline,thebetter. toQA. Althoughthetrackingsystemisfastandquitepreciseitis QCCsendsQAmessagesregardingtheuser’sinteraction not always robust. Like a lot of other optical tracking with the environment, specifically it sends movement systems,QAVE’sopticaltrackingsystemusescolormarkers. commands. However, most other applications have stable backgrounds There are four types of messages sent by QCC to the andlightingconditions,withtheQAVEthisisnotthecase. QDCs: ThescreensoftheQAVEshowbrightdynamicimagesthat 1. messagesthatspecifythepositionoftheuser’shead cannotalwaysbepredicted,ifascreenisinacamera’sfield 2. messagesthatspecifythepositionoftheuser’shand ofviewandthepicturecontainsthesamecolorsthatareused 3. messagesthatspecifyviewrotation bythemarkers,thetrackingsystemcaneasilygetconfused 4. messagesthatshutdowntheQDCs and lose track of the object it was tracking. Luckily, in QDC sends QA messages specifying the perspective systemsthatdonothavefullysurroundingdisplaysthiscan correction, headand hand position (in virtual worldunits), beresolvedbypositioningthecamerasothatitdoesn’tfacea andviewrotation. screen. Another problem with the screens is that they are often the main source of lighting, this lighting is usually coloredwhichcanthenchangetheperceivedcolorofobjects but that normally doesn’t cause major problems. Low light 5. TRACKING SYSTEM andchangesintheintensityofthelightareabiggerproblem. QAVE uses an optical tracking system based on two Trackingtheuser’shandhasspecialproblemsofitsown. camerasandtwocolormarkers(onefortheheadandonefor Unlike the headwhich is positioned above the body of the hand). Details about the previous version of the tracking userandisneverhiddenbyit,thehandismuchlowerandthe systemthatusedasinglecameracanbefoundin[9]. user’sbodyoftenhidesitfromatleastonecamera,theonly way to alleviate this problem is to position the cameras in suchawaythatitisnotpossibleorlikelyforthehandtobe problematic lighting and background conditions that are an occludedbythebody. inescapablepartofCAVElikesystems. QAVE offers a complex interactive virtual environment, andalthoughthesystemisnotperfectinthisearlystageof 6. USING THE QAVE development, it does provide a viable platform for the development of immersive virtual reality applications. The The QAVE has been designed with a simple but very QAVE system is an open and scalable system, and with efficientuserinterface;thereareonlytwobasic actions the additional development it can be improved and provide a user needsto performtointeractwith the system: pointing highVRexperience. and dragging. When moving around inside the QAVE the There are aspects that should be improved upon. One perspectivewillbeautomaticallycorrectedbuttheuserwill aspectisbettertracking.Althoughupgradeshavebeenmade not move inside the virtual environment (the point of view tothetrackingsystemthereisstillroomforimprovement,a will,butnottheavatar).Iftheuserwantstomovesomewhere possiblewaytoaccomplishthisistomovefromthevisible s/he just has to point in the desired direction and gesture range of the light spectrum to the near infrared. Another whether s/he wants to goforward or reverse (by using the aspectisfullstereoscopicsupportwhichwouldrequiresome littlefinger),fastorslow(usingthethumb).Figure3shows moregamemodificationbutalsoawayoftrackingtheuser’s thegestureusedtomoveinreverse.Withdisplaysthatdon’t head orientation. This can be accomplished by using an have a full 360 degree view it is sometimes necessary to inertialorientationtrackerorbyfurtherimprovingtheoptical rotatetheview,todothistheusersimply“grabs”theview, trackingsystem. dragsitaroundinthedirectionitneedstoberotated,andthen letsitgo. REFERENCES [1] C. CruzNeira, D. Sandin, T. DeFanti, R. Kenyon, J. Hart: “The CAVE®: Audio Visual Experience Automatic VirtualEnvironment”,CommunicationsoftheACM,vol35, no6,pp.6572,1992. [2] J. Jacobson, M. Lewis: “Game Engine Virtual Reality with CaveUT”,IEEE Computer,vol.38,no.4,pp. 79 82,2005. [3] J.Jacobson,M.LeRenard,J.Lugrin,M.Cavazza:“The CaveUT system: immersive entertainment based on a game engine”,Proceedingsofthe2005ACMSIGCHIinternational Conference on Advances in Computer Entertainment Figure 3 - Glove gesture for reverse movement Technology(Valencia,Spain,June1517,2005).ACE'05. ACMPress,NewYork,NY,184187. [4] CAVEQUAKEII, 7. CONCLUSION AND FUTURE WORK brighton.ncsa.uiuc.edu/~prajlich/caveQuake/ [5] M. Lewis, J. Jacobson: “Game Engines in Scientific Inthispaperwepresentedtheopticaltrackingsystemfor Research”,CommunicationsoftheACM,vol.45,no1,pp. the QAVE, a CAVElike system based on the id Tech 3 2731,2002. computergameengine.Wehaveshownhowagamecanbe [6] Michael Zyda: “From Visual Simulation to Virtual adaptedtosupportthecreationofanimmersivemultiscreen RealitytoGames”,IEEEComputer,vol.38,no9,pp.2532, displayforaCAVElikesystem.TheidTech3engine has 2005. alsobeenalteredtosupportactiveperspectivecorrectionand [7] Open Source Computer Vision Library, enablecontrolwithanexternalprogram.QAVEiscomprised www.intel.com/technology/computing/opencv/ of three programs running on several computers and in [8] GaryR.Bradski:“RealTimeFaceandObjectTracking multiple instances, the central program coordinates the as a Component of a Perceptual User Interface”,4th IEEE functioning of the system by using a simple unidirectional WorkshoponApplicationsofComputerVision(WACV'98), messagepassingprotocol.Thesystemutilizesheadtracking 1998. to facilitate perspective correction, and head and hand [9] D.Baričević,H.Dujmić,M.Šarić:“QAVE–aGame tracking combined with dataglove gesture recognition to basedImmersiveVirtualRealitySystem”,Proceedingsofthe create an easytouse user interface. The optical tracking 18thInternationalConferenceonInformationandIntelligent systemisfastandprecisebutnotalwaysrobustdue to the Systems,pp.357,Varaždin,Croatia,1214September2007.