Integration of a 3D Rendering Engine with a Physics Simulator
Total Page:16
File Type:pdf, Size:1020Kb
Universitat de Lleida Escola Politècnica Superior Màster en Enginyeria de Programari Lliure Treball de final de Màster Integration of a 3D rendering engine with a physics simulator Author: Alberto Montañola Lacort Directors: Carlos Ansótegui Gil Juan Manuel Gimeno Illa June 2009 Integration of a 3D rendering engine with a physics simulator Index 1.Introduction.........................................................................................9 1.1.Project Description.......................................................................9 1.2.Project Goals..............................................................................10 1.3.Document structure...................................................................10 2.Definitions, concepts and technology...............................................13 2.1.Definitions..................................................................................13 2.1.1.The scene............................................................................13 2.1.2.Scene Objects......................................................................14 2.2.Technologies...............................................................................18 2.2.1.The rendering engine..........................................................18 2.2.1.1.The rendering process..................................................19 2.2.1.2.Low level programing interfaces...................................20 2.2.1.3.High level programing interfaces..................................21 2.2.2.The input system.................................................................21 2.2.3.The Graphical User Interface...............................................22 2.2.4.The physics simulation subsystem......................................23 2.2.5.The Audio subsystem..........................................................23 2.2.6.The Networking subsystem.................................................23 2.2.7.Application Logic.................................................................24 2.2.8.Linking the services.............................................................24 3.Requirements analysis......................................................................29 3.1.Basic idea of possible client applications...................................29 3.1.1.Educational..........................................................................29 3.1.2.A game................................................................................30 3.1.3.Scientific applications..........................................................32 3.2.Developing a Framework, the Hollywood principle.....................32 3.3.The clients of our framework......................................................33 3.4.Use Cases - Putting it all together..............................................34 Page iii Index Alberto Montañola Lacort 3.4.1.Developer tasks...................................................................35 3.4.1.1.Build..............................................................................35 3.4.1.2.Publish and distribute...................................................36 3.4.1.3.Maintain code...............................................................36 3.4.2.Content creator tasks..........................................................37 3.4.2.1.Material creation and edition........................................37 3.4.2.2.Testing...........................................................................37 3.4.2.3.Material management...................................................37 3.4.3.Application...........................................................................38 3.4.3.1.Configure......................................................................38 3.4.3.2.Provide basic services...................................................38 3.4.3.3.Register module............................................................39 4.State of the art..................................................................................41 4.1.Complete engines......................................................................42 4.1.1.Crystal Space.......................................................................42 4.1.2.Unreal Engine......................................................................43 4.1.3.id Tech.................................................................................44 4.1.4.Shark 3d..............................................................................45 4.2.Graphics.....................................................................................46 4.2.1.Ogre3d.................................................................................46 4.2.2.Irrlicht..................................................................................47 4.3.Physics.......................................................................................49 4.3.1.ODE.....................................................................................49 4.3.2.PhysX...................................................................................50 4.3.3.Bullet...................................................................................51 4.4.Sound.........................................................................................52 4.4.1.OpenAL................................................................................52 4.5.Summary of technologies...........................................................53 4.5.1.Complete engines................................................................53 4.5.2.Graphics engines.................................................................53 Page iv Integration of a 3D rendering engine with a physics simulator 4.5.3.Physics engines...................................................................53 5.Project infrastructures and community.............................................55 5.1.Source code repository...............................................................55 5.2.Bug reporting and patches.........................................................55 5.3.Documentation...........................................................................56 5.4.Message boards..........................................................................57 5.5.Linking authentication and users with all applications...............57 6.Selected technologies.......................................................................59 6.1.Python as the programing language..........................................59 6.1.1.Python programing architectures........................................61 6.1.2.Python specialized compiler – Psyco....................................62 6.2.Building tools..............................................................................63 6.2.1.SWIG....................................................................................63 6.2.2.Py++...................................................................................64 6.2.2.1.Boost.............................................................................65 6.2.3.Conclusions..........................................................................65 6.3.The graphics rendering library - Ogre 3d...................................66 6.4.The Graphical User Interface – CEGUI........................................68 6.5.The Input System – OIS..............................................................68 6.6.The Physics Simulator – ODE......................................................69 6.7.The Sound Library - OpenAL.......................................................69 6.8.Legal compatibility of library licenses........................................70 7.Engine Design – Assembling everything...........................................75 7.1.BootStrap...................................................................................75 7.1.1.Introduction.........................................................................75 7.1.2.Usage...................................................................................75 7.1.3.Involved classes...................................................................77 7.2.Engine facade.............................................................................78 7.3.World Manager...........................................................................82 7.4.Renderer.....................................................................................84 Page v Index Alberto Montañola Lacort 7.5.Input...........................................................................................85 7.6.GUI.............................................................................................86 7.7.Hook Manager............................................................................86 7.8.Physics.......................................................................................89 7.9.Sound.........................................................................................90 7.10.Network Manager.....................................................................90 8.Conclusions.......................................................................................91 9.Future work and open research lines................................................95 10.Appendix A – Download and build...................................................97 10.1.Minimal Recommenced Hardware requirements......................97 10.1.1.Building Requirements.......................................................97 10.1.2.Running Requirements......................................................97