Procedural Animation and Physics Engine Yingcai Xiao.

Slides:



Advertisements
Similar presentations
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Advertisements

Graphics Pipeline.
Morphing & Warping 2D Morphing Involves 2 steps 1.Image warping “get features to line up” 2.Cross-dissolve “mix colors” (fade-in/fadeout transition)
3D Graphics Rendering and Terrain Modeling
CSE 380 – Computer Game Programming Pathfinding AI
INNER WORKINGS OF UNITY 3D. WHAT WE ARE GOING TO COVER Intro to Unity Physics & Game Objects Cameras & Lighting Textures & Materials Quaternions and Rotation.
HCI 530 : Seminar (HCI) Damian Schofield.
Computer Graphics Hardware Acceleration for Embedded Level Systems Brian Murray
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Yingcai Xiao Game Development with Unity3D Inside/Outside Unity3D.
(conventional Cartesian reference system)
Texture Mapping from Watt, Ch. 8 Jonathan Han. Topics Discussed Texture Map to Models Bump Maps, Light Maps Environment (Reflection) Mapping 3D Textures.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
CSE 6367 Computer Vision Stereo Reconstruction Camera Coordinate Transformations “Everything should be made as simple as possible, but not simpler.” Albert.
MULTIMEDIA TECHNOLOGY SMM 3001 MEDIA - GRAPHICS. In this chapter how the computer creates, stores, and displays graphic images how the computer creates,
Physics and Sound Zhimin & Dave. Motivation Physical simulation Games Movies Special effects.
Yingcai Xiao Surface and Volume Representation and Procedural Animation Yingcai Xiao.
Polygon Shading. Assigning color to a shape to make graphical scenes look realistic, or artistic, or whatever effect we’re attempting to achieve But first.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CSE 381 – Advanced Game Programming Basic 3D Graphics
EEC-693/793 Applied Computer Vision with Depth Cameras Lecture 13 Wenbing Zhao
Shading. What is Shading? Assigning of a color to a pixel in the final image. So, everything in shading is about how to select and combine colors to get.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 1 Shading (Shading) & Smooth Shading Graphics.
Main Navigation  Similar to Unity 3D  Unlike Unity it is a right handed coordinate system  Used to determines whether a positive rotation is clockwise.
Game Object Appearance. The Three Faces of Designing GO Appearance The Artistic Face: ◦ aesthetic – beautiful and ugly ◦ done by artists The Communication.
Yingcai Xiao Voxel Game Engine Development. What do we need? What tools do we have? How can we design and implement? We will answer those questions in.
Particle Systems – Technique for Modeling a Class of Fuzzy Objects Craig Schroeder Computer Graphics I April 22, 2004.
Yingcai Xiao Game Development Interactive Animation.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Ray Tracing.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
Yingcai Xiao Game Development Animation. Video Game Interactive animation: user-> interface (look) -> action (feel) -> feedback (A/V, haptic)
Shader Study 이동현. Vision engine   Games Helldorado The Show Warlord.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Yingcai Xiao Game Development with Unity3D. Outline IDE Engine Assets Tutorial Examples Inside.
A Few Things about Graphics Jian Huang Computer Science University of Tennessee.
Basic Ray Tracing CMSC 435/634.
Artistic Surface Rendering Using Layout Of Text Tatiana Surazhsky Gershon Elber Technion, Israel Institute of Technology.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
Representation and modelling 3 – landscape specialisations 4.1 Introduction 4.2 Simple height field landscapes 4.3 Procedural modeling of landscapes- fractals.
Subject Name: Computer Graphics Subject Code: Textbook: “Computer Graphics”, C Version By Hearn and Baker Credits: 6 1.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
Module 06 –environment mapping Module 06 – environment mapping Module 06 Advanced mapping techniques: Environment mapping.
X-Toon: An Extended Toon Shader Pascal Barla, Joelle Thollot ARTIS GRAVIR/IMAGE INRIA Lee Markosian University of Michigan.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
Image-Based Rendering Geometry and light interaction may be difficult and expensive to model –Think of how hard radiosity is –Imagine the complexity of.
OUTPUT PRIMITIVES A.Aruna/Faculty of Information technology/SNSCE13/19/2016.
Yingcai Xiao Interactive Game Design Final Overview Yingcai Xiao.
Yingcai Xiao Game Development with Unity3D Inside/Outside Unity3D.
Digital Media Dr. Jim Rowan ITEC 2110 Vector Graphics II.
Game Development with Unity3D
Interactive Animation
Basic Ray Tracing CMSC 435/634.
EEC-693/793 Applied Computer Vision with Depth Cameras
Game Development with Unity3D Inside/Outside Unity3D
Fluid Animation CSE 3541 By: Matt Boggus.
EEC-693/793 Applied Computer Vision with Depth Cameras
Game Development Unity3D.
3D Graphics Rendering PPT By Ricardo Veguilla.
© University of Wisconsin, CS559 Fall 2004
EEC-693/793 Applied Computer Vision with Depth Cameras
Chapter 14 Shading Models.
CSC461: Lecture 23 Shading Computation
Introduction to Game Development
Game Development Animation
Dr. Jim Rowan ITEC 2110 Vector Graphics II
EEC-693/793 Applied Computer Vision with Depth Cameras
Chapter 14 Shading Models.
Dr. Jim Rowan ITEC 2110 Vector Graphics II
Presentation transcript:

Procedural Animation and Physics Engine Yingcai Xiao

Outline What is it? How to design it in a game? How to design it in a game engine? How to implement it in Unity3D?

Yingcai Xiao Procedural Animation Dynamically generated by a procedure (function) at runtime. Flexible: can use any algorithms, can simulate real- world phenomenon (Good for building physics engines). Precise: no key frames, no lerping, can have smooth animation of any order in time and space.

Yingcai Xiao Procedural Animation of Dynamics

. Motion Dynamics Change of GO’s Geometry: location size orientation shape Change of Camera: location orientation FOV (field of view) focal point

. Update Dynamics Change of GO’s Attributes: color texture lighting shading/reflection (via normal, material properties)

Yingcai Xiao Procedural Animation of Motion Dynamics (Wave Example)

. GO: Swimming Pool Animation: Wave Motion Procedure: Physics Equations Data Structure: Elevation Grid

Data Structure Data Structure Design Criterion Compact (save space) Efficient (fast retrieval) Map-able (easy to convert) Minimal Coverage (small foot prints) Simple (easy to use)

Uniform Grid  Commonly used in game engines as Elevation Grid for terrain data structure.  Compact: No need to store x, z values,; they are calculated at runtime.  Parametric space (i,j)  x = i*d x + x 0; 0<= i < n x  z = j*d z + z 0; 0<= j < n z  Data array (i, j), loop i first, then j.  Speedy retrieval of data in a 2D array.  Simple  Not flexible

Elevation Grid  Elevation Grid is a special case of Uniform Grid.  IK space  x = i*d x + x 0; 0<= i < n x  z = j*d z + z 0; 0<= j < n z  Elevation values stored in as data at every grid note.  The stored y value along with the computed x, z values define the coordinates of each grid note.

Yingcai Xiao Elevation Grid origin: 0,0 spacing: 2, 2 dimension: 3, 3 elevation: 10,20,30, 11,21,31, 21, 22, 33

Yingcai Xiao Physics of Waves

A snapshot of a decaying cosine wave V(r) = e -r cos(10r);

. 1D Cosine Wave: y = COS(x);

Yingcai Xiao Procedural Animation of Update Dynamics (Wave Example)

Change the shades to simulate waves  Shades are produced by reflection.  Reflection at each location depends on the surface normal at the location.  If we change the normal by following the wave motion pattern, it could appear as a real wave.

Shading Shading: determining light reflection from objects at each pixel. Basic Reflection Model: Phong Reflection Model (most commonly used) I= k a I a + k d I d (l · n) + k s I s (v · r ) α I : reflected-light intensity

Procedural Animation in Unity3D Learn how to use scripts to change the geometry of game objects at run-time. Example: change the geometry of a plane to a simulate a wave.

Example in Unity3D To change the geometry of a plane to simulate a wave. Create a new project with Character Controller package. Add a plane (GameObject->CreateOhters->Plane) Scale it in the Inspector to 10X10 (in x and z). Uncheck the Mesh Collider (in the Inspector) Add a light (GameObject->CreateOhters->DirectionalLight) Add a FPC (Project->Assets->StandardAssets- >CharacterControllers->FirstPersonController, drag-and- drop it to Hierarchy.) Move it up. (Change its y position in the Inspector to 11). Add script to morph the plane (Plane->Inspector- >AddComponent->NewScript->JavaScript) name it Wave. Add the code on the next page to the Wave.js in Mono. Build->Build All in Mono to make sure there is no compilation errors.

Demo in Unity3D (Wave) #pragma strict function Start () { var mesh: Mesh = this.GetComponent(MeshFilter).mesh; var verts: Vector3[] = mesh.vertices; for (var v = 0; v < verts.Length; v++) { verts[v].y = Random.Range(0,10); } mesh.vertices = verts; mesh.RecalculateBounds(); mesh.RecalculateNormals(); this.gameObject.AddComponent(MeshCollider); } function Update () { }

Cosine Wave Formula y(r,t) = A e -r-at cos(2 π (r-Vt) / λ ); r = sqrt ((x-x 0 )*(x-x 0 )+ (z-z 0 )*(z-z 0 )) P 0 (x 0, y 0, z 0 ) : center of the wave A: amplitude of the wave V: velocity of the wave λ : wave length of the wave a: speed of decaying t = current time – time of impact (t 0 )