Shapes Properties Binding 2001.08.14 Chung Ji Hye.

Slides:



Advertisements
Similar presentations
8.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 8 Polygon Rendering.
Advertisements

CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
2 COEN Computer Graphics I Evening’s Goals n Discuss the fundamentals of lighting in computer graphics n Analyze OpenGL’s lighting model n Show.
3D Graphics Rendering and Terrain Modeling
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.
Shading in OpenGL CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
(conventional Cartesian reference system)
Shading in OpenGL Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
7M836 Animation & Rendering
Texture mapping. Adds realism to computer graphics Texture mapping applies a pattern of color Bump mapping alters the surface Mapping is cheaper than.
Illumination and Shading. Rendering Simulation of physical interaction of light and matter. Physically correct shading is too complex –Material layers.
02/04/03 Page 1 Rendering Visibility Lighting Texturing.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CS324e - Elements of Graphics and Visualization Checkerboard World.
Shading in OpenGL.
Introducing To 3D Modeling George Atanasov Telerik Corporation
CSE 381 – Advanced Game Programming Basic 3D Graphics
Computer Graphics I, Fall 2010 Shading in OpenGL.
1 Virtual Reality Modeling Language (VRML97) ©Anthony Steed
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Game Programming 06 The Rendering Engine
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
111/16/ :14 UML Instance Transformation x y z x y z x y z x y z SRT Model Coordinates.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
VRML Anthony Steed Department of Computer Science University College London ©Anthony Steed
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Illumination and Shading
Course Introduction to virtual engineering Óbuda University John von Neumann Faculty of Informatics Institute of Applied Mathematics Lecture and laboratory.
Shading in OpenGL Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E.
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.
Modeling, CG, and others Jyun-Ming Chen Fall 2001.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques Presented by SooKyun Kim.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 9 Lighting and Texturing.
1 9 Lighting a Scene v There are four types of lighting: –ambient light –directional light –point light –spotlight v Any number of these can be added to.
Graphics Graphics Korea University cgvr.korea.ac.kr Lighting, Fogging, Alpha Blending & Progressive Meshes Byeong-Seon Jeong
Visual Appearance Chapter 4 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
Local Illumination and Shading
11/24/ :45 Graphics II Shadow Maps Reflections Session 5.
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
Revision Sheet Computer Graphics and Human Interaction By Dr. HANY ELSALAMONY1.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Digital Media Dr. Jim Rowan ITEC 2110 Vector Graphics II.
Computer Graphics: Illumination
1 Geometry for Game. Geometry Geometry –Position / vertex normals / vertex colors / texture coordinates Topology Topology –Primitive »Lines / triangles.
Chapter 5. Lighting Computer Graphics (spring, 2009) School of Computer Science University of Seoul.
© University of Wisconsin, CS559 Spring 2004
3D Graphics Rendering PPT By Ricardo Veguilla.
Shading in OpenGL Ed Angel
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
Illumination and Shading
Introduction to Computer Graphics with WebGL
Dr. Jim Rowan ITEC 2110 Vector Graphics II
Computer Graphics 4Practical Lesson
Game Programming Algorithms and Techniques
Computer Graphics Shading in OpenGL
Shading in OpenGL Ed Angel Professor Emeritus of Computer Science
Presentation transcript:

Shapes Properties Binding Chung Ji Hye

Graphics Laboratory Korea University -2- chung ji hye Content Use a variety of shapes in the scene Indexed shapes specify their own order Different effects for color values, shininess and transparency Render a scene using different drawing styles Create a scene with fog Use the shape hints Material and normal binding

Graphics Laboratory Korea University -3- chung ji hye Shapes All shape nodes are derived from the abstract base class SoShape Simple shape Complex shapes CubeCube Face set Cone Line set Sphere Tirangle strip set Cylinder Quad mesh

Graphics Laboratory Korea University -4- chung ji hye Complex Shapes [FaceSet] SoFaceSet is a shape node Represents a polygonal object Current coordinates, normals, materials, textures Uses the values within each node in the order they are given SoIndexedFaceSet Represents a polygonal object formed by constructing faces Uses those values in any order Contains four field

Graphics Laboratory Korea University -5- chung ji hye Complex Shapes [FaceSet] Four Fields coordIndex Contains indices into the coordinates list SO_END_FACE_INDEX(-1) materialIndex Contains indices into the current material for the materials of the face set Use only when some type of indexed material binding is specified in the SoMaterialBinding node NormalIndex Contains indices into the current normals SoNormalBinding node TextureCoordIndex Contains indices of the texture coordinates

Graphics Laboratory Korea University -6- chung ji hye Complex Shapes Triangle Strip Set SoTriangleStripSet constructs triangle strips out of the vertices One of the fastest ways to draw polygonal object Starting by startIndex field (in order) Static long numvertices[2] ={32, 8}; SoTriangleStripSet *myStrips = new SoTriangleStripSet; myStrips->numbertices.setValues(0,2, numVertices); //32 triangle stripset, 8 triangle stripset //face 0 determined the vertex ordering

Graphics Laboratory Korea University -7- chung ji hye Triangle Strip Set Triangle Strip Set Example

Graphics Laboratory Korea University -8- chung ji hye Complex Shapes Quad Mesh SoQuadMesh Constructs quadrilaterals from the vertices located at the current coordinates Use the coordinates in order Starting at the index specified by the startIndex field verticesPerColume : number of vertices in the columns VerticesPerRow : number of vertices in the rows

Graphics Laboratory Korea University -9- chung ji hye Complex Shapes Examples SoQuadMesh *myQuadMesh = new soQuadMesh; myQuadMesh->verticesPerRow = 12 myquadMesh ->VerticesPerColumn = 5 Static float vertexPositions[160][3] = { //1 st row { }, // Add 11 rows }; Each row in this quad mesh contains 12 vertices. Each column contains 5 vertices

Graphics Laboratory Korea University -10- chung ji hye Quad Mesh

Graphics Laboratory Korea University -11- chung ji hye Property Nodes Property classes SoMaterial Sets ambient, diffuse, specular, emissive color, shininess, transparency SoDrawStyle Drawing technique to use during rendering SolightModel Shape nodes show to compute lighting calculations during rendering SoEnvironment Simulate various atmospheric effects (fog, haze, pollution … )

Graphics Laboratory Korea University -12- chung ji hye Property Nodes Property classes SoShapeHints Additional information regarding vertex shapes to allow inventor to optimize certain rendering features SoUnits Define a standard unit of measurement for all subsequent shapes in the scene graph All of which are derived from SoNode Each of these classes affects different elements of the rendering state

Graphics Laboratory Korea University -13- chung ji hye Material Node SoMaterial node includes the following fields ambientColor(SoMFColor) Reflected color of an object in response to the ambient lighting in the scene diffuseColor Object ’ s base color specularColor Reflective quality of an Object ’ s highlights

Graphics Laboratory Korea University -14- chung ji hye Material Node SoMaterial node includes the following fields emissiveColor Light produced by an objcet Shininess Degree of shininess of an object ’ s surface 0.0 : no shininess Transparency Degree of transparency of an object ’ s surface( 0.0 : opaque)

Graphics Laboratory Korea University -15- chung ji hye Material Node Examples //set material values SoMaterial *Gold = new soMaterial; Gold -> ambientColor.setValue(.3,.3,.1); Gold ->diffuseColor.setValue(.8,.7,.2); Gold ->specularcolor.setValue(.4,.3,.1); Gold -> shininess =.4; Gold -> transparency =.0; //gold is opaque

Graphics Laboratory Korea University -16- chung ji hye Draw Style Node SoDrawStyle node include Style Current drawing style SoDrawStyle::FILLED Filled regions(default) SoDrawStyle::LINES Nonfilled outlines SoDrawStyle::POINTS Points SoDrawStyle::INVISIBLE Not drawn at all

Graphics Laboratory Korea University -17- chung ji hye Draw Style Node solid point line

Graphics Laboratory Korea University -18- chung ji hye Draw Style Node SoDrawStyle node include pointSize radius of points, in printer ’ s points 0.0 indicates to use the fastest value for rendering lineWidth Line width in printer ’ s points Values can range from 0.0 to linePattern Line-stipple pattern Values can range from 0 to 0xffff

Graphics Laboratory Korea University -19- chung ji hye Light-Model Node SoLightModel node includes field Model Tells the shape node how to compute lighting calculations during rendering SoLightModel::BASE_COLOR Ignore light source Uses only diffuse color and transparency of the current material SoLightModel::PHONG Uses the OpenGL Phong lighting model Account all light sources in the scene

Graphics Laboratory Korea University -20- chung ji hye Environment Node SoEnvironment node Simulate various atmospheric effects – fog, haze, pollution and so on Allows you to specify color, intensity, ambient lighting, many factor for fog Includes fields ambientIntensity intensity of ambient light in the screen Used with phong lighting attenuation Defines how light drops off the distance from a light source Used with phong lighting

Graphics Laboratory Korea University -21- chung ji hye Environment Node SoEnvironment node Includes fields fogType SoEnvironment::NONE SoEnvironment::HAZE Opacity of the fog Increases linearly with the distance from the camera SoEnvironment::FOG Opacity of the fog Increases exponentially with the distance from the camera fogColor Color of the fog

Graphics Laboratory Korea University -22- chung ji hye Shape-Hint Node Use the SoShapeHints node to notify Inventor It can optimize certain rendering features Includes fields vertexOrdering Provides hints about the ordering of the faces of a vertex based shaped derived from SoVertexShape Describes the ordering of all the vertices of all the faces SoShapeHints::COLCKWISE SoShapeHints::COUNTERCLOCKWISE SoShapeHints::UNKNOWN_ORDERING

Graphics Laboratory Korea University -23- chung ji hye Shape-Hint Node Includes fields shapeType SoShapeHints::UNKNOWN_SHAPE_TYPE SoShapeHints::SOLID(not an open surface) Turns on backface culling & turn off two sided lighting faceType SoShapeHints::UNKNOWN_SHAPE_TYPE SoShapeHints::CONVEX

Graphics Laboratory Korea University -24- chung ji hye Complexity Node SoComplexity node Amout of subdivision into polygons for subsequent shape node in the scene graph Three fields Type General type of complexity SoComplexity::SCREEN_SPACE SoComplexity::OBJECT_SPACE Value Provides a hint about the amount of subdivision desired textureQuality Hint about the quality of texture mapping used on the object

Graphics Laboratory Korea University -25- chung ji hye Complexity Node example OBJECT_SPACESCREEN_SPACE

Graphics Laboratory Korea University -26- chung ji hye Units Node SoUnits node Define your data in a variety of different units Acts like a scale node by scaling subsequent shapes into the specified units SoUnits::METERS SoUnits::CENTIMETERS SoUnits::MILLIMETERS SoUnits::KILOMETERS SoUnits::YARDS

Graphics Laboratory Korea University -27- chung ji hye Binding Nodes SoMaterialBinding How to bind materials to shapes SoMaterialBinding::DEFAULT Uses the best binding for each shape SoMaterialBinding::OVERALL Uses the first current material for the entire shape SoMaterialBinding::PER_PART Binds one material to each part in the shape SoMaterialBinding::PER_PART_INDEXED Binds one material to each part by index And so on …

Graphics Laboratory Korea University -28- chung ji hye Thinking If the number of current materials is greater than the number of parts? Simply ignore the extra materials if they ’ re not required If the current material contains fewer values than the binding requires? Cycles through the current values as often as needed

Graphics Laboratory Korea University -29- chung ji hye Indexed Binding Use the current material values in a new order Inventor refer to the materials-index field of the shape node(SoIndexdFaceSet, SoIndexedLineSet) PER_FACE_INDEX, PER_VERTEX_INDEX … Example SoIndexedFaceSet Material List 0 peach 1 khaki 2 white Material Index 1, 1, 0, 2

Graphics Laboratory Korea University -30- chung ji hye Indexed Binding Specify PER_FACE Ignores the materialIndex field, cycles in order Face1 peach (0) Face2 khaki (1) Face3 white (2) Face4 peach (0) Specify PER_FACE_INDEXED Face1 khaki (1) Face2 khaki (1) Face3 peach(0) Face4 white (2)

Graphics Laboratory Korea University -31- chung ji hye Binding per Vertex PER_VERTEX Selects materials in order from the materials list PER_VERTEX_INDEXED Selects materials in order from the materials index

Graphics Laboratory Korea University -32- chung ji hye Normal Binding SoNormalBinding node Type of normal binding specified Hint to the shape node about how to apply the current normals to that shape SoIndexedFaceSet, SoIndexedTriangleStripSet Contain a normalIndex field normalIndex field store indices into the normals list Ginding specifed does not require indices, the normalindex field is not used Indexed normals do not cycle

Graphics Laboratory Korea University -33- chung ji hye Generating normals Automatically SoVertexShape Normals can be generated automatically for any shape derived Generating normals DEFAULT normal binding is used Do not specify any normals The number of normals is different from the number of vertices

Graphics Laboratory Korea University -34- chung ji hye Transformations Cumulative effect on the current geometric transformation SoTransform Node Translation Translation in x, y, z Rotation Rotation in terms of an axis and angle : x, y, z, angle scaleFactor Scaling factor in x, y, z ScaleOrientation Ratation to apply before the scale is applied Center Center point for rotation and scaling

Graphics Laboratory Korea University -35- chung ji hye Order of Transformations Last field in the node affects the shape object first The groups with transformations in different order

Graphics Laboratory Korea University -36- chung ji hye Order of Transformations Effects of ordering transformation