Rujchai Ung-arunyawee Department of Computer Engineering Khon Kaen University.

Slides:



Advertisements
Similar presentations
Polygon Rendering Flat Rendering Goraud Rendering Uses Phong Reflectance Phong Rendering.
Advertisements

1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
Shared Graphics Skills Cameras and Clipping Planes
Lighting and Illumination Lighting is the major problem in computer graphics, for either realism or real-time compositions- harder than modeling Consider.
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
CS 4363/6353 INTRODUCTION TO COMPUTER GRAPHICS. WHAT YOU’LL SEE Interactive 3D computer graphics Real-time 2D, but mostly 3D OpenGL C/C++ (if you don’t.
1 of 25 Assignment Orthographic Wireframe Elevation Orthographic Wireframe Plan Orthographic Wireframe End-Elevation Perspective View.
Lecture 4: 3D Rendering Pipeline (I) Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology.
FUNDAMENTALS OF PROGRAMMING SM1204 Semester A 2011.
Three-Dimensional Concepts
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
Getting started © juhanita2015.
Lecture 5: 3D Rendering Pipeline (II) Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology.
Introduction to 3D Computer Graphics and Virtual Reality McConnell text.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
COMP 175: Computer Graphics March 24, 2015
Introducing To 3D Modeling George Atanasov Telerik Corporation
3D Objects Subject:T0934 / Multimedia Programming Foundation Session:12 Tahun:2009 Versi:1/0.
Week 2 - Wednesday CS361.
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 1 Shading (Shading) & Smooth Shading Graphics.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Lecture 6: 3D graphics Concepts 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271 
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
Game Programming 06 The Rendering Engine
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Computer Graphics Basic 3D Geometry CO2409 Computer Graphics Week 5-1.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
A Few Things about Graphics Jian Huang Computer Science University of Tennessee.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Vertices, Edges and Faces By Jordan Diamond. Vertices In geometry, a vertices is a special kind of point which describes the corners or intersections.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
A Photograph of two papers
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
FUNDAMENTALS OF PROGRAMMING SM1204 SEMESTER A 2012.
 UV mapping is a process of applying textures to an object by hand  Figure: Blender model textured through a UV map.
Chapter 1 Graphics Systems and Models Models and Architectures.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
GLSL Review Monday, Nov OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
3D Ojbects: Transformations and Modeling. Matrix Operations Matrices have dimensions: Vectors can be thought of as matrices: v=[2,3,4,1] is a 1x4 matrix.
A Photograph of two papers The Model: 2 papers – 8cm x 8cm and 5cm x 5cm The Camera – Simple pinhole – No focusing capability The Scene – Arrangements.
Introduction to Computer Graphics
Rendering Pipeline Fall, 2015.
Jim Fawcett Brown-Bag Seminar, December 2007
Jim Fawcett Brown-Bag Seminar, December 2007
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
CS451Real-time Rendering Pipeline
Models and Architectures
Three-Dimensional Concepts. Three Dimensional Graphics  It is the field of computer graphics that deals with generating and displaying three dimensional.
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
Common Classification Tasks
A Photograph of two papers
Models and Architectures
Computer Graphics 4Practical Lesson
Models and Architectures
Game Programming Algorithms and Techniques
Presentation transcript:

Rujchai Ung-arunyawee Department of Computer Engineering Khon Kaen University

3D Graphics Basics: The Scene A three dimensional model of an object A camera that takes a picture of the object A viewport (projection surface) for a picture, which is a projection of the object to a planar surface The 3D rendering engine determines the color for every pixel by calculating the amount of light that is reflected by any light sources All surfaces of objects have a material (brush). The material defines how much light is reflected for a specific angle and the brush defines the color. A brush can either be a simple color or a gradient or even an image called texture

3D WPF is a world of triangles A surface of a 3D object is called a mesh A mesh is defined by a number of 3D points called Vertices (Vertex) The vertices are joined together by a winding pattern to define the triangles Every triangle has a front and a back side. Only the front side is rendered WPF uses a counter clockwise winding pattern

WPF is a right handed coordinate system

WPF Elements of a 3D scene Viewport3D The viewport is the control that builds the gate between the 2D and the 3D world. Camera Every 3D scene has excactly one camera. The camera defines the Position and the LookDirection and the UpDirection of the viewer. WPF supports orthographical and perspective cameras. 3D Models A 3D model defines an object in the scene. It has a Geometry that is the mesh and a Material that can be a diffuse, specular or emmisive material. The material itself has a brush. Lights Without any lights you see nothing. So we need to place at least one light in our scene to illuminate our models

A Point in Space In C# code, we create and initialize a Point3D object: In XAML, you represent a Point3D objects as a text string with spaces and/or single commas separating the numbers: or

Points in Space In C# code, use the Point3DCollection class In XAML, just by listing them in a string:

Vectors A vector encapsulates a magnitude and a direction

Points and Vectors Relationship For vector (x v, y v, z v ), the direction of the vector is the direction from the origin (0, 0, 0) to the point (x v, y v, z v ). The magnitude of the vector (M) is The normalized vectors or unit vectors will have magnitude of 1 point ± point  vector point ± vector  point vector * D  vector vector / D  vector

Define the 3D object

Define the simplest light A 3D scene usually requires some light. If you don't have any light in a 3D scene, you'll still be able to see the figures you've created, but they won't have any color Different types of light are available in WPF 3D The simplest light is a class named AmbientLight which has a white color by default. or

Define the simplest camera The camera must be located in a specific position in 3D space by setting the Position property You also need to specify a direction in which the camera is pointed by setting the LookDirection property. The simplest camera Sits right on the positive Z axis, which means that the X and Y coordinates are set to zero Points in a direction parallel to the negative Z axis, which is the vector (0, 0, –1)

Camera In the scene

The Viewport3D and Its Constituents We generally define a whole 3D scene inside a Viewport3D element It can be a part of a larger layout of elements, and it can receive mouse, keyboard, and stylus input Viewport3D defines a ModelVisual3D and Camera properties. ModelVisual3D has a property named Content Each Content might contains GeometryModel3D or Light GeometryModel3D has a Geometry, Material, and BackMaterial properties.

Ggeneral structure of a simple Viewport3D

Put everything together

Model3DGroup Combine the geometry and light into one

Light sources AmbientLight Setting a Color property DirectionalLight Setting Color and Direction properties. PointLight SpotLight

DirectionalLight PointLight SpotLight

Camera Perspective Camera Orthographic Camera

PerspectiveCameraOrthographicCamera

LookDirection property A vector that points from the Position property to the target point (x, y, z). If the Position property is (–2, 0, 5) and the target is the origin (0, 0, 0), the calculation is ( 0, 0, 0) – (–2, 0, 5) = (2, 0, –5) It's also possible to calculate LookDirection so that the center of the triangle appears in the center of the display (0, 0.5, –1) – (–2, 0, 5) = (2, 0.5, –6)

Field Of View (FOV)