Presentation is loading. Please wait.

Presentation is loading. Please wait.

Research and Development of a Physics Engine by Timmy Loffredo.

Similar presentations


Presentation on theme: "Research and Development of a Physics Engine by Timmy Loffredo."— Presentation transcript:

1 Research and Development of a Physics Engine by Timmy Loffredo

2 As the processing power of modern computers grows, it is becoming more and more feasible to create accurate, graphical simulations of three dimensional physics. In the field of computer games, for example, powerful 3D physics engines are starting to become standard practice. Introduction A screenshot from Half Life 2, demonstrating its superior physics.

3 This project aims to research modern physics modeling techniques and create a rudimentary but powerful physics engine. Most games focus on rigid body dynamics, a small but important subset of all physics, and so did this project. A small foray into spring modelling was made, also. Goal and Scope of Study

4 Background There are a multitude of publicly available physics engines out there, some of commercial product quality, some not. I have chosen, initially, to model my engine after a previous engine written by Chris Hecker. In a series of 4 articles for a programming magazine, Hecker presents a simple method for creating a 3D physics simulator capable of collisions for rigid, polygonal solids.

5 Theory There is a large branch of game development devoted to the production of physics engines. Here are a few examples of the theory involved. Acceleration must be integrated into velocity, and velocity into position. This requires a numerical integrator, like Euler's algorithm from calculus. The one detailed above is called leapfrog. 3D rotation is a tricky thing to implement. My project uses 3x3 matrices to represent orientation, as opposed to Euler angles or axis- angle rotation.

6 Design Criteria and Resources Used The criteria for a successful physics engine is that (a), it looks real, and (b), it accurately simulates physics. My personal goal was to implement 3D collisions between arbitrary polygonal solids, which, in the end, proved too difficult to work well. Other things, however, like spring demonstrations and the pool game, turned out splendidly. I will be using Java for my programming language, Netbeans IDE for my programming environment, and LWJGL, an openGL port to Java, for my graphics engine.

7 Workplan ● Framework – setting up window etc. ● Kinematics – acceleration, velocity, position ● Angular Kinematics – orientation, rotation ● Dynamics – forces on objects ● Springs – fixed or free springs ● Collision Detection – decide when things collide ● Collision Handling – responding to collisions ● Rest – special module for objects resting on a surface ● Pool Game – just what it sounds like ● 2D Soft Pressure bodies – bendable things, just for fun at the end

8 Testing Some tests I've run: A network of springs designed to simulate cloth. A box with spheres bouncing around in it.

9 Testing My personal favorite, the pool game:

10 Everything up to Dynamics worked just as planned. It seems a powerful rigid body simulator is feasible for large projects, since the time taken for each step of physics calculation was almost a tenth of the time for graphical calculations. Results Collisions have been less successful. Spherical collisions are easy enough and work well, but polygonal collisions sometimes have odd results. The objects bounce off each other in unusual directions. Springs were surprisingly effective and useful in a variety of ways. They can do much more than cloth simulation; they could be the basic unit for an entire physics engine. Sometime, I would like to explore more about spring physics.

11 Conclusion Physics simulation is a blossoming field with many applications in the near future. I have learned that it is a much wider field than I initially imagined, from water effects to particle effects to rigid body collisions to spring models. Any programming team could spend years working on a physics engine without ever exploring all the possibilities. I suggest that the next physics project explore a different aspect of physics – whatever seemingly small subfield that interests you most.


Download ppt "Research and Development of a Physics Engine by Timmy Loffredo."

Similar presentations


Ads by Google