Yingcai Xiao Surface and Volume Representation and Procedural Animation Yingcai Xiao.

Slides:



Advertisements
Similar presentations
CSE554Cell ComplexesSlide 1 CSE 554 Lecture 3: Shape Analysis (Part II) Fall 2014.
Advertisements

Visualization Data Representation Ray Gasser SCV Visualization Workshop – Fall 2008.
You Have Much To Learn Grasshopper
Extended Gaussian Images
ATEC Procedural Animation Introduction to Procedural Methods in 3D Computer Animation Dr. Midori Kitagawa.
A Bezier Based Approach to Unstructured Moving Meshes ALADDIN and Sangria Gary Miller David Cardoze Todd Phillips Noel Walkington Mark Olah Miklos Bergou.
GATE D Object Representations (GATE-540) Dr.Çağatay ÜNDEĞER Instructor Middle East Technical University, GameTechnologies & General Manager SimBT.
Yingcai Xiao SCATTERED DATA VISUALIZATION. Scattered Data: sample points distributed unevenly and non-uniformly throughout the volume of interest. Example.
Modelling. Outline  Modelling methods  Editing models – adding detail  Polygonal models  Representing curves  Patched surfaces.
2003 by Jim X. Chen: Introduction to Modeling Jim X. Chen George Mason University.
Implicit Surfaces Tom Ouyang January 29, Outline Properties of Implicit Surfaces Polygonization Ways of generating implicit surfaces Applications.
Content Subdivision First some basics (control point polygon, mesh)
IE433 CAD/CAM Computer Aided Design and Computer Aided Manufacturing Part-4 Computer Graphics- CAD Software Dr. Abdulrahman M. Al-Ahmari Industrial Engineering.
Disediakan oleh Suriati bte Sadimon GMM, FSKSM, UTM Graphics modeling.
ITUppsala universitet Data representation and fundamental algorithms Filip Malmberg
Computer-Aided Drawing (CAD)
1 Finite-Volume Formulation. 2 Review of the Integral Equation The integral equation for the conservation statement is: Equation applies for a control.
Introduction to Modeling. What is CG Modeling? Combination of Sculpting, Architecture, Drafting, and Painting. The core component of computer animation.
MS. WILLIAMS Anatomy of a 3D Model. 3D Model 3D Models are one of the essential building blocks of 3D computer graphics. Without them there would be no.
Spatial data models (types)
Modeling and representation 1 – comparative review and polygon mesh models 2.1 Introduction 2.2 Polygonal representation of three-dimensional objects 2.3.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
In the name of God Computer Graphics Modeling1. Today Introduction Modeling Polygon.
Grid Generation.
VTK: Data Shroeder et al. Chapter 5 University of Texas – Pan American CSCI 6361, Spring 2014 After Taku Komura and other lecture sets
CS559: Computer Graphics Lecture 33: Shape Modeling Li Zhang Spring 2008.
CSE 381 – Advanced Game Programming Basic 3D Graphics
October 14, 2014Computer Vision Lecture 11: Image Segmentation I 1Contours How should we represent contours? A good contour representation should meet.
Geometric Modeling using Polygonal Meshes Lecture 1: Introduction Hamid Laga Office: South.
University of Coimbra Reconstruction of Voxels from Sensor Data Ricardo Martins Coimbra, 19 th January 2010 Doctoral Programme in Electrical Engineering.
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.
Mesh Generation 58:110 Computer-Aided Engineering Reference: Lecture Notes on Delaunay Mesh Generation, J. Shewchuk (1999)
Object Representation Rama C Hoetzlein, 2010 Univ. of California Santa Barbara Lecture Notes.
CSE 381 – Advanced Game Programming Code Setup.
CS559: Computer Graphics Lecture 24: Shape Modeling Li Zhang Spring 2010.
Geometric Objects and Transformation
Mesh Coarsening zhenyu shu Mesh Coarsening Large meshes are commonly used in numerous application area Modern range scanning devices are used.
1 Polygonal Techniques 이영건. 2 Introduction This chapter –Discuss a variety of problems that are encountered within polygonal data sets The.
GOOGLE SKETCHUP AZHARUDEEN K 2012HW B. CONTENTS GOOGLE SKETCHUP-INTRODUCTION 3-D COMPUTER GRAPHICS FEATURES OF GOOGLE SKETCHUP USES OF GOOGLE.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Ship Computer Aided Design MR 422. Geometry of Curves 1.Introduction 2.Mathematical Curve Definitions 3.Analytic Properties of Curves 4.Fairness of Curves.
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.
Mesh Resampling Wolfgang Knoll, Reinhard Russ, Cornelia Hasil 1 Institute of Computer Graphics and Algorithms Vienna University of Technology.
Data Visualization Fall The Data as a Quantity Quantities can be classified in two categories: Intrinsically continuous (scientific visualization,
CDS 301 Fall, 2008 Domain-Modeling Techniques Chap. 8 November 04, 2008 Jie Zhang Copyright ©
DPL3/10/2016 CS 551/651: Simplification Continued David Luebke
Yingcai Xiao Interactive Game Design Final Overview Yingcai Xiao.
67 x 89 = ? 67 x
UNIT 11: 3D AutoCAD Objectives: How to print or plot a drawing How to setup a layout using title blocks and viewports Create and manage new layouts Be.
3D Object Representations. Introduction Line and circle and polygon algorithms- represented simple and smooth object. Some Natural object are neither.
Computer – Aided Design Terminology You must have a generic understanding of commands and techniques which are used in a number of packages (YOU CANNOT.
3D Object Representations 2009, Fall. Introduction What is CG?  Imaging : Representing 2D images  Modeling : Representing 3D objects  Rendering : Constructing.
Procedural Animation and Physics Engine Yingcai Xiao.
Game Development with Unity3D
VTK: The Visualization Toolkit
Constructing Objects in Computer Graphics
POLYGON MESH Advance Computer Graphics
Decimation Of Triangle Meshes
Introduction to Graphics Modeling
Constructing Objects in Computer Graphics By Andries van Dam©
3D Printing Yingcai Xiao.
Domain-Modeling Techniques
Procedural Animation Lecture 3: Types of 3D models
Computing Vertex Normals from Arbitrary Meshes
CSE 554 Lecture 3: Shape Analysis (Part II)
Presentation transcript:

Yingcai Xiao Surface and Volume Representation and Procedural Animation Yingcai Xiao

Outline Why? Surface Representation Volume Representation Procedural Animation Application in Unity3D

Yingcai Xiao Why? Waves of tsunami Splashes of diving Drilling into the ground Moving inside an object (fluids)

Yingcai Xiao Surface Representations

. Analytical Planes: ax + by + cz + d=0 e.g. y = 0;

. Analytical Curved Surfaces : ax 2 + by 2 + cz 2 + dxy + eyz + fzx + gx + hy + iz + j = 0 a-j are constants. x 2 + y 2 + z 2 = 64;

. Analytical Parametrical Surfaces : x = x (s,t); y = y (s,t); B-Splines

Parametric Form of a line:  x(t) = x 0 + t * (x 1 – x 0 )  y(t) = y 0 + t * (y 1 – y 0 )  0 <= t <= 1  x(t) = (1-t) * x 0 + t * x 1  y(t) = (1-t) * y 0 + t * y 1  0 <= t <= 1

. Analytical Parametrical Surfaces : x = x (s,t); y = y (s,t); B-Splines Use control points to design the surface 1.jpg

Yingcai Xiao Surface Representations Discrete Forms

Yingcai Xiao Elevation Grid origin: 0,0,0 spacing: 1,1,1 dimension: 5, 5 elevation: 1,2,3,4,5, 11, 12, 13, 14, 15, 21, 22, 23, 24, 25, 31, 32, 33, 34, 35, 41, 42, 43, 44, 45

Carpet Plots V(r) = e -r cos(10r); r = sqrt (x*x + z*z)

Triangular Integrated Networks (TIN)

Triangle Strip Generation Triangle strips are compact representations of triangle polygons. Greedy method: The longer the average strip length is the better.

Triangulation: Connect points to form a triangulated topological structure. (topology generation)

Triangulation Use Edge Swapping to make a Delaunay Triangulation. 1. Find the minimum bounding triangle. (may need to add a fake point) 2. Add one point at a time, do triangulation. 3. After each point is added, check if the joined triangles are optimal or not; if not swap the joining edge (edge swapping). Check all other triangles and make sure they are still optimal after adding the current point. 4. Repeat step 3 to add each point and we when all points are added and all triangles are optimal. 5. Clean up: remove all fake points and related triangles.

Yingcai Xiao Surface Display

Polygon Normal Generation Shading Reflection: I~f(N,C) i.e., C.N.  I Normal may not be given by the programmer. Facet Normal: Compute normal of a polygon from its vertexes. Ex.

Polygon Normal Generation: facet / polygonal normals

Polygon Normal Generation Vertex Normals: Use the average of the facet normals in the use set.

Polygon Normal Generation Vertex Normals: Shaded using vertex normal (average of facet normals), too smooth.

Polygon Normal Generation Feature Angle ~80 0 <90 0 Take the facet out of the average computation if the connected facets have angle greater than the feature angle

Decimation Polygon Reduction (Vertex Reduction) Threshold Distance:  For lines:  is the distance to the line without the vertex.

Decimation For surface:  is the distance to the surface without the vertex.

Mesh Smoothing No reduction, no topology change. But the geometry changes to make the mesh smooth.

Mesh Smoothing No reduction, no topology change. But the geometry changes to make the mesh smooth.

Yingcai Xiao Volume Representations Discrete Forms

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)

Volumetric Data Structure Structure: topology and geometry Topology: is the set of properties invariant under certain geometric transformations. Geometry: is the instantiation of the topology; the specification of positions in a 3D space. The structure consists of cells and points. The cells specify the topology; while the points specify the geometry. Dataset Attributes: Normals, texture coordinates, and user-defined data.

Cell Types A data set consists of one or more cells A cell is defined by a “type” and an ordered list of point Type: topology, cell type Ordered list: geometry, points Together: organizational structure Use Set: all the cells using a point: U(p i ) = {C i : p i  C i } A data set consists of one or more cells A cell is defined by a “type” and an ordered list of point Type: topology, cell type Ordered list: geometry, points Together: organizational structure Use Set: all the cells using a point: U(p i ) = {C i : p i  C i }

Cell Types Vertex: zero-dimensional cell, It is defined by a single point. Line: one dimensional cell. It is defined by two points. Polyline: is a composite one-dimensional cell consisting of n connected lines. It is defined by an ordered list of n+1 points. Triangle: is a primary two-dimensional cell. The triangle is defined by a counter- clockwise ordered list of three points. Polygon: is a primary two-dimensional cell. The polygon is defined by an ordered list of three or more points lying in a plane Tetrahedron: is a primary three-dimensional cell. It is defined by a list of four nonplanar point. Hexahedron: is a primary three-dimensional cell. It is defined by a list of eight nonplanar point. Voxel: volume element, the smallest unity of a 3D grid, usually, a hexahedron. Vertex: zero-dimensional cell, It is defined by a single point. Line: one dimensional cell. It is defined by two points. Polyline: is a composite one-dimensional cell consisting of n connected lines. It is defined by an ordered list of n+1 points. Triangle: is a primary two-dimensional cell. The triangle is defined by a counter- clockwise ordered list of three points. Polygon: is a primary two-dimensional cell. The polygon is defined by an ordered list of three or more points lying in a plane Tetrahedron: is a primary three-dimensional cell. It is defined by a list of four nonplanar point. Hexahedron: is a primary three-dimensional cell. It is defined by a list of eight nonplanar point. Voxel: volume element, the smallest unity of a 3D grid, usually, a hexahedron.

Types of Datasets Dependent on topology of the dataset. Uniform Grid (uniform in each direction)  Parameters:  Dimension: n x, n y, n z  Origin: x 0, y 0, z 0  Spacing: d x, d y, d z

Uniform Grid  IJK space  x = i*d x + x 0  y = j*d y + y 0  z = k*d z + z 0  Data array (i, j, k), loop i first, then j, k last.  Simple, compact and speedy retrieval.  Not flexible

Yingcai Xiao Elevation Grid: a special case of uniform grids origin: 0,0 spacing: 1,1 dimension: 5, 5 elevation: 1,2,3,4,5, 11, 12, 13, 14, 15, 21, 22, 23, 24, 25, 31, 32, 33, 34, 35, 41, 42, 43, 44, 45

Rectlinear Grid  Dimension: n x, n y, n z  Nonuniform spacing, but straight grid lines. float x[44]={0.0,1.2,2.8,3.9…….} float y[33]={1.0,……………} float z[22]={0.8,……………}

Rectlinear Grid  IJK space. x = x[I]; y = y[J]; z = z[K];  Data array (i, j, k), i changes first, then j, k last.  Simple  compact (takes O(n x + n y + n z ) more space)  speedy retrieval  Little more flexible

Structured Grid  Dimension: n x, n y, n z  Nonuniform spacing  IJK space (no formula)  Coordinates of each grid node need to be given. x(I,J,K), y(I,J,K), z(I,J,K)

Indexed Surface and Volume Data Structures

Structure Representation P1 of T1 and P2 of T2 are connected at P(1,0,0)

Structure Representation The Wrong Way: Making Copies class Tri{ public: point P 1, P 2, P 3 ; }; Tri T1, T2; T1.P 1.x=1.0; T1.P 1.y=0.0; T1.P 1.z=0.0; ……. T2.P 2.x=1.0; T2.P 2.y=0.0; T2.P 2.z=0.0; ………

Structure Representation: Wrong Way Each triangle keeps a copy of the vertex values. Drawback: if the coordinates of P are changed, all cells having a copy of its value need to be updated.

Structure Representation: Correct Way Save the vertex values in an array (Point List). Store the indexes of the vertexes for each triangle in the triangle definition

Structure Representation The Correct Way: Indexing Point List P 0.x=0.0; P 0.y=0.0; P 0.z=0.0; P 1.x=1.0; P 1.y=0.0; P 1.z=0.0; P 2.x=1.0; P 2.y=1.0; P 2.z=0.0; P 3.x=0.0; P 3.y=1.0; P 3.z=0.0;

Structure Representation The Correct Way: Indexing class Tri{ public: int ID 1, ID 2, ID 3 ; }; Tri T1, T2; T1.ID 1 =0; T1.ID 2 =1; T1.ID 3 =3; T2.ID 1 =1; T2.ID 2 =2; T2.ID 3 =3;

Structure Representation: The Correct Way: Indexing Each triangle keeps an index list (cell list) of its vertexes. If the coordinate of P is changed, none of the cells using it needs to be changed. Only the one copy of its value in the point list needs to be updated.

Indexed Volume / Surface No dimensions parameters: n x, n y, n z No IJK space Coordinates of each node need to be given Most flexible, can represent any structures Easy to modify geometry, only need to change the point list. Not compact (need space to save xyz values and cell information) Slow retrieval

Indexed Data Structure

Summary of Volumetric Data Structures

Converting non-indexed to an indexed structure. Elevation grid => Triangular strips Uniform grid => Hexahedral mesh Uniform grid => Tetrahedral mesh

Morphing and Procedural Animation

Morphing Special effect hat changes (morphs) one image or geometry into another.

Morphing Geometric morphing: modify the xyz values in the point list in a coordinated way. open source for creating animation characters. makehuman_morphing_process.html

Procedural Morphing Use scripts to change the geometry of game objects at run-time. A demo in Unity3D to change the geometry of a plane to a wave form.

Demo in Unity3D To change the geometry of a plane to a wave form. 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 () { }

Time-dependent Carpet Plots 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 )

Advanced Morphing Tools

- Major Issues Mesh generation Mesh modification Mesh node identification Grid based: x(i), y(j), z(k) Indexed: node => x, y, x X, y, z => node (graphical)

- Free software for students from AutoDesk Popular 3ds Max: 3D modeling, animation, rendering, and compositing software for games, film, and video content. AutoCAD (Computer Aided Design) CAD design, drafting, modeling, drawing, and engineering software. Inventor Professional 3D CAD software 3D mechanical CAD, visualization, and documentation software. Revit Building Information Modeling (BIM) tools for architectural design, MEP, and structural engineering.

- Maya: free for students from AutoDesk 3D animation, modeling, simulation, rendering, and compositing software Can be used to generate morphing. -Use Maya to create a 3D object. -Duplicate it and modify the duplicate to the needed shape. -Use Blend Shape Deformer of Maya to recognize all of the shapes. -Import the shapes into Unity3D. -Write C# or JavaScript to control the morphing animation.

MegaFiersMegaFiers plugin for Unity3D -Mesh deformation, animation and Morphing system. -Over 50 modifiers such as Bend, Twist, FFD, Displace. -Wave in a pond at1:24 in the first video. MegaFlowMegaFlow plugin for Unity3D Fluid flow simulation. CFD: Computational Fluid Dynamics using PDEs (partial deferential equations.) Volumetric rendering is challenging.

MegaFiersMegaFiers / MegaFlow plugin for Unity3DMegaFlow Mesh deformation example: Bending. Morphing example: Lysosomes.

Surface Morphing: -Mesh deformation via changing vertex values (geometry and attributes) of the surface mesh. -The surface mesh could represent the enclosure of a solid object. Volumetric Morphing / Deformation: Deformation based on changing the representation of a volume. Voxel (Volume Element) based processing algorithms. Voxel What could be changed: geometry, attributes, and topology (e.g. iso-surface generation).