1 / 43

Simulation and 3D Graphics

Jeffrey Heer Berkeley Institute of Design Computer Science Division University of California, Berkeley http://www.sims.berkeley.edu/academics/courses/is146/s05/. Simulation and 3D Graphics. IS146: Foundations of New Media. Lecture Overview. Review of Last Time Today Simulation Engines

abby
Télécharger la présentation

Simulation and 3D Graphics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Jeffrey Heer Berkeley Institute of Design Computer Science Division University of California, Berkeley http://www.sims.berkeley.edu/academics/courses/is146/s05/ Simulation and 3D Graphics IS146: Foundations of New Media

  2. Lecture Overview • Review of Last Time • Today • Simulation Engines • 3D Graphics • Preview of Next Time • Prof. Greg Niemeyer from Art Practice

  3. Lecture Overview • Review of Last Time • Today • Simulation Engines • 3D Graphics • Preview of Next Time • Prof. Greg Niemeyer from Art Practice

  4. Lecture Overview • Review of Last Time • Today • Simulation Engines • 3D Graphics • Preview of Next Time • Prof. Greg Niemeyer from Art Practice

  5. What is simulation? • A simulation is a procedural representation of aspects of “reality”

  6. What is simulation? • A simulation can be defined as “an operating representation of central features of reality.” This definition again identifies two central features that must both exist before an exercise can reasonably be described as a simulation. First, it must represent an actual situation of some sort--either a situation drawn directly from real life, or an imaginary situation that conceivably could be drawn from real life (invasion by extraterrestrial beings, for example). Second, it must be operational, i.e., must constitute an on-going process-- a criterion that effectively excludes from the class of simulations static analogues such as photographs, maps, graphs, and circuit diagrams, but includes working models of all types.

  7. What is simulation? • A set of entities or phenomena of interest, boiled down to essential characteristics of representation (e.g., shape, position, etc) • A set of procedures or rules for how the state of these entities evolves. • In programming terms: data structures + procedural abstractions acting on them. • Simulations are far from perfect - they leave out information on purpose!

  8. Designing Simulations • Given a phenomena to simulate, the problem is to decide what are its parts, how these parts can be represented with numerical values, and what the relationships are that let these parts affect one another… • Making a simulation is a process of abstracting--of selecting which entities and which properties from a complex real phenomena to use in the simulation program. For example, to simulate a bouncing ball, the ball’s position is important but its melting point probably isn’t. Any model has limitations, and is not a complete representation of reality. • Key points: Abstract, Numerical, Limited

  9. Game of Life Simulation • The Game of Life was devised by the British mathematician John Conway in 1970. It made its first public appearance in the October 1970 issue of Scientific American • Simulated cells living and dying - perhaps the most classic example of simulation • Simple rules give rise to complex behavior • emergent phenomena • “the often hidden relationship between the formal structure of a game and the experience of that structure through play” (my italics)

  10. Game of Life Simulation • DEMO • http://www.bitstorm.org/gameoflife/

  11. Game of Life Simulation • Represented entities • “Living” cells arranged on a grid • Simulation procedure • Populated grid slot: • 1 or fewer neighbors: die (loneliness, starvation) • 4 or more neighbors: die (overpopulation) • 2-3 neighbors: live • Empty grid slot: • 3 neighbors: new cell (reproduction)

  12. Game of Life Simulation Block Boat Blinker Toad Glider LWSS “Still Lifes” “Oscillators” “Spaceships” Diehard (130) Acorn (5206) “Methesulahs” Gosper Glider Gun “Breeders”

  13. Game of Life Simulation • What the game of Life seems to do most eloquently is demonstrate the amazing complexity inherent in even simple systems, and how stunning order and beauty can be found in even the murkiest times of chaos. • After realizing that which looked like a huge throbbing mass of nothing two turns ago is now a perfectly symmetrical stable system, you will see what I mean. Also, seeing if you can create sets of life that can accomplish specific goals (travel across the screen, shoot out travelers, etc.) is a pleasant affirmation of the fact that structured organisms CAN wander out of a pile of primordial soup. (from Dan Norton, flakmag.com)

  14. What is simulation? • A video game is an imaginary world: its inhabitants are nonexistent creatures that nevertheless the eye can see, and the hand can move. It is imaginary in the sense that there is no solid reality behind the picture. A bouncing ball may be faithfully simulated, but that moving blip of light has no real mass or elasticity. The ball’s position, velocity, mass, and elasticity are just numbers stored in the computer that controls the video game; and the laws of physics that govern the ball’s trajectory and it bounce are just mathematical equations stored in the computer’s program. --Warren Robinett

  15. Physics Simulation • How do we simulate real-world physical phenomena? • Realistic motion, inertia, gravity, elasticity,… • This is central to numerous video games, 3D worlds, flight simulators, sports simulations, military tests… and the list goes on.

  16. Physics Simulation • DEMO • http://www.sodaplay.com/zoo/index.htm

  17. Simple Physics Simulation • Represented entities • Objects • Mass, Position, Velocity, Force • Springs • Stretchiness, Resting Position • Forces • Gravity, Air Resistance • Simulation procedure • Objects repel each other (“anti-gravity”) based on mass and position • Springs push or pull based on position of end-points • Objects are slowed by air resistance dependent on their current velocity

  18. Physics Simulations • N-Body Forces F = G * mass1 * mass2 / distance^2 • Spring Forces F = -stretchiness * distance from resting • Drag Forces (Viscosity, Air Resistance) F = resistance * velocity • Gravity F = mass * gravitational pull

  19. 3D Graphics as Simulation • Computer Images are 2D • (in fact, so is all retinal vision) • Depth cues, perspective, shading, occlusion, etc allow us to perceive images as being 3D representations • These images exploit our perception to simulate 3D worlds. How?

  20. 3D Graphics Simulations • Represented entities • 3D Models of Characters and Objects • Combinations of shapes modeled in 3D space • Colors and Textures of these Shapes • Lighting Sources • Camera Position • Simulation procedure • Generate 2D Image from 3D Model • Perspective Projection • Ray-Tracing / Radiosity

  21. Collections of Shapes

  22. …to 3D Imagery http://home.comcast.net/~tomjking/

  23. The 2D Basics • Computer Image = 2D Grid (the Raster) • Each grid entry is a number indicating color • Drawing Primitives (remember LOGO?) • setColor, drawLine, drawRect, fillRect, drawEllipse, fillEllipse, drawCurve • So how to go from here to 3D? • Procedural Abstraction • Simulation

  24. Put It In Perspective

  25. Put It In Perspective

  26. 3D Rendering Approaches • Scan Conversion • 3D Model -> 2D Model -> Image • Transform geometry (to handle perspective) • Raytracing • Directly generate image by simulating the path of light rays through the scene • (but do it in reverse!)

  27. Raytracing

  28. Raytracing

  29. Raytracing

  30. Raytracing • Send rays to light sources to know shadow conditions

  31. Raytracing Effects • Power of a general simulation • Reflection (let light rays continue after hitting a surface, add up colors along the way) • Refraction (redirect light ray’s path in response to surface) • Can warp the viewing surface (fisheye views, simulate vision problems) • Drawbacks • This takes computational power - good for movies or imagery, bad for real-time games.

  32. Raytracing • Reflection

  33. Raytracing • Refraction

  34. Raytracing • Warped viewing surfaces

  35. Shading Languages

  36. Repeated Themes • Game of Life, Physics, Raytracing • Model of “World” • Cells, Objects / Springs / Forces, Shapes / Lights / Textures • Actions/operations on that world • Live / Die, Physical Laws, Ray Casting / Reflection / Refraction • Basic rule structure gives rise to an amazingly complex space of possibilities

  37. Games as Simulation of Conflict • Territorial • Chess, Checkers, RISK, Halo, Quake • Economic • Monopoly, Magic the Gathering • Knowledge • Trivial Pursuit, Hollywood Squares • Other Arenas Possible • Social, Psychological conflict

  38. Levels of Simulation • General Simulation Engine (“Simulation”) • A rich framework for simulating phenomena, based on generative principles. • Ex: A character jumping in a rich physics simulations (e.g., Halo) • Case-Based Simulation (“Emulation”) • Explicit simulation rules for handling specific cases. • Ex: A character jumping in Mario Bros. • Most games interleave the two, depending on desired levels of detail.

  39. Immersive Fallacy • The idea that the pleasure of a media experience lies in its ability to sensually transport the participant into an illusory, simulated reality. • Counter-Point • “… but the very thing that makes their activity play is that they also know they are participating within a constructed reality, and are consciously taking on artificial meanings” • Toolmaker’s Paradigm: remember Text1 vs Text2?

  40. Nick Reid on Play • Can Computers “Play”? Can Software “Play”? Can Hardware “Play”? • Salen and Zimmerman make constant reference as games and play being rules in motion. Is this true? What is “motion”? Regardless of those answers, what are the effects of these ludic structures in motion? What is left behind? Is there anyway to digitally represent these “ludic artifacts”?

  41. Nick Reid on Play • “ . . . Caillois defines play by virtue of its structural identity.” (p.309) • This quote struck me as akward because at first I had no idea what exactly it meant. Earlier S&Z quotes various forms and definitions of types of games from Caillois, so, what the quote probably means is that the identity of the structure is what defines the type of play. When I first read it, I immediately thought about networks, and the structures of social identities, and tried to put that into play – epically paida, so my question is, how could one represent game or play structures as a “graph”?

  42. Lecture Overview • Review of Last Time • Today • Simulation Engines • 3D Graphics • Preview of Next Time • Prof. Greg Niemeyer from Art Practice • Henry Jenkins. Art Form for the Digital Age, MIT Technology Review, (September/October 2000). • Discussion Questions: Sharmaine Lewis

More Related