Cs 352: Interactive 3D Computer Graphics
Slide 2This Class Interactive 3D Graphics Programming (with an essence of 2D illustrations, photorealistic, picture handling, displaying, and client interfaces) Top-down methodology Course Information Syllabus Policies Platform Projects
Slide 3Intelligence Chart
Slide 4Comet Simulation COMET CRASH - Sandia supercomputer reproductions of an one-kilometer comet entering Earth\'s air, drawing closer the sea\'s surface, and affecting the sea, disfiguring the sea depths and making a titan high-weight steam blast ascending into the stratosphere. The blast launches comet vapor and water vapor into ballistic directions that spread far and wide. The New York City horizon is appeared for scale.
Slide 5Ray-followed Image
Slide 6Animation Interim Examples
Slide 7Aspects of Graphics Design versus Programming Interactive versus Photorealistic 2D versus 3D Graphics versus picture preparing versus client interfaces
Slide 8OpenGL Programming OpenGL : a broadly utilized, open API Old Procedural C versus C++ Accessible Support Need equipment support for top execution Drivers accompany Windows, Mac OS X (however Windows drivers werenât quickened until Vista) Drivers accessible for Unix/Linux for a few representation cards (e.g. nvidia) Use lab PCs with design cardsâor your own particular PC
Slide 9OpenGL versus Direct3D: MS just Used more for recreations Latest adaptations are great OpenGL Used more for expert applications Cross-stage (for all intents and purposes all OSs, amusement supports) Latest forms: expansions, section programs (otherwise known as pixel shaders) OpenGL ES: for PDAs, and so on. Weâll utilize more fundamental components of OpenGL
Slide 10Other programming weâll use POV beam tracer ImageMagick picture control library QT 2D windowing library from Trolltech Cross-stage GUI toolbox: windowing, 2D and 3D representation Also backings organizing, interactive media, XML, ⦠Used in KDE (âbest GUI toolbox for UNIXâ) Commercial and Open Source (GPL) variants 3D Modeling: Lightwave 3D?
Slide 11Chapter 1: Graphics Systems and Models A Graphics System Processor Memory Frame Buffer Display Input Devices Output Devices
Slide 12Graphics Architecture
Slide 13Images Array of pixels Red , Green , Blue May likewise have an alpha worth (straightforwardness)
Slide 14Pixels and the Frame Buffer Pixels: picture components 3 values: RGB, 0-255 or 0-65536 or 0.0-1.0 4 values: RGBA (Alpha = straightforwardness) Frame cushion Depth: bits per pixel Indexed versus genuine nature Uses quick, double ported VRAM Bandwidth required from VRAM to DAC (advanced to-simple converter)?
Slide 15Frame Buffer, LUT and DAC Look-up table maps shading record - > full shading Digital to simple converter proselytes R, G, and B numbers to voltages
Slide 16CRT Display
Slide 17Shadow Mask
Slide 18Display terms Electron weapon Scan line Resolution Horizontal and vertical re-follow Refresh, revive rate Interlace Phosphor Triad NTSC, PAL, S-feature, Composite, DV
Slide 19LCD Display An unpowered LCD layer changes polarization of light
Slide 20Other I/O gadgets Virtual Valuators Selectors Physical Mouse, console Buttons & Dials Fancy showcases VR gear
Slide 21VR equipment
Slide 22The Human Visual System Rods: night vision Cones: day vision Three sorts of cones, with diverse shading affectability We model and render for its abilities
Slide 23Spectral Sensitivity Color range: 780 nm (blue)â¦350 nm (red)
Slide 24Graphics Paradigms Modeling Rendering Photo-practical: Ray following Radiosity Interactive: Projection â camera model Transformations, cut-out Shading Texture mapping Rasterization
Slide 25Ray Tracing Ray Tracing
Slide 26Ray-followed blob
Slide 27How does Ray-Tracing work? Displaying Build a 3D model of the world Geometric primitives Light sources Material properties Simulate the ricocheting of light beams Trace beam from eye through picture pixel to see what it hits From there, bob beam in reflection course, towards light source, and so forth. In this manner, model material science of outflow, reflection, transmission, and so on (in reverse)
Slide 28Modeling the World camera { area <0, 5, - 5> look_at <0, 0, 0> edge 58 } light_source { <- 20, 30, - 25> shading red 0.6 green 0.6 blue 0.6 } blob { limit 0.5 circle { <- 2, 0, 0>, 1, 2 } chamber { <- 2, 0, 0>, <2, 0, 0>, 0.5, 1 } barrel { <0, 0, - 2>, <0, 0, 2>, 0.5, 1 } barrel { <0, - 2, 0>, <0, 2, 0>, 0.5, 1 } color { shading red 1 green 0 blue 0 } complete { encompassing 0.2 diffuse 0.8 phong 1 } pivot <0, 20, 0> }
Slide 29Ray through pixel
Slide 30Flat blob
Slide 31Bounce toward lights
Slide 32Shadows
Slide 33Shaded blob
Slide 34Blob with Highlights
Slide 35Blob with ground plane
Slide 36Blob with straightforwardness
Slide 37Blob with refraction
Slide 38Types of brightening Ambient â "light soup" that influences each point just as Diffuse â shading that relies on upon the surface\'s edge to the light source Specular â "highlights." Falls off pointedly far from the reflection course Example: lighting applet
Slide 39What are these made of?
Slide 40Material sorts Dielectrics (non-channels): In body reflection, light enters the surface and is influenced by material shade Highlights are the light\'s shade source Examples: paint, plastic, wood, ⦠Conductors (metals) No light infiltrates the surface Highlight and "body" reflection are influenced just as by the material Same shading for diffuse and specular reflection
Slide 41Finishes
Slide 42Textures
Slide 43Surface (Ripples)
Slide 44POV-Ray Primitives
Slide 45Constructive Solid Geometry
Slide 46Sunsethf
Slide 47How to beam trace⦠Transparency? Refraction? Reflection? Haze?
Slide 48Drawbacks of beam following? Time: numerous beams are required per pixel⦠Up to 25 beams through every pixel Each beam may skip and split ordinarily Each beam tried for crossing point with numerous items E.g. 1M pixels * 25 beams for each pixel * 40 beams for each beam tree * 1000 items = 1 trillion article convergence tests⦠Hard lighting No delicate shadows, between article dissemination, and so on
Slide 49POV-Ray An amazing, free beam tracer: POV-Ray We\'ll use for a brief introduction to beam following Runs on PC, Unix, Mac, Beowolf bunches, ⦠Installed on the PCs in the Unix lab You may wish to introduce all alone PC First "lab": make a beam followed picture of four distinct sorts of primitives, one every plastic, glass, metal, and reflected, over checked floor
Slide 50Radiosity Treat every patch as reflector and emitter of light Each patch influences each other patch contingent upon separation, introduction, impediment and so forth. Let light "bounce around" for a couple of emphasess to register the measure of light coming to a patch
Slide 51Radiosity picture
Slide 52Radiosity - table
Slide 53Radiosity in POV-Ray
Slide 54Radiosity illustration
Slide 55Radiosity outline Radiosity gives sublime delicate shading But considerably slower than beam tracing⦠Can\'t do reflection, refraction, specular highlights with radiosity Can join beam following and radiosity for best of both universes (and double the time)
Slide 56Interactive strategies Ray following and radiosity are too moderate We\'ll focus on intuitive methods What sort of rendering should be possible rapidly ?
Slide 57Shutterbug - Orthographic
Slide 58- Perspective
Slide 59- Depth Cueing
Slide 60- Depth Clipping
Slide 61- Colored Edges
Slide 62- Hidden line evacuation
Slide 63- Hidden surface evacuation
Slide 64- Flat shading
Slide 65- Gouraud shading
Slide 66- Gouraud/specular
Slide 67- Gouraud/phong
Slide 68- Curved surfaces
Slide 69- Improved light
Slide 70- Texture mapping
Slide 71- Displacements, shadows
Slide 72- Reflections
Slide 73Synthetic camera Model the world and the camera Find the focuses on plane where world focuses show up ( projection ) One technique works like a pinhole camera Foundation of mod-ern 3D representation
Slide 74Pinhole camera model We draw a line ( projector ) from picture point, through Center of Projection (COP), to picture (projection plane) x p = - x/(z/d), y p = - y/(z/d) -
Slide 75Formulations of the pinhole model "Film" can be considered as behind or in front of COP
Slide 76Camera Applet We can try different things with the camera model utilizing this camera applet
Slide 77Clipping Any parts of the picture anticipating outside the unmistakable district are "clipped" (dispensed with)
Slide 78Programmer\'s Interface The engineered camera model is the premise of well known APIs, for example, OpenGL, Direct3D, PHIGS, VRML, Java-3D
Slide 79APIs API: application program interface. Protect program from equipment. The API must permit us to display the earth, as we did in beam following Need to model Objects (primitives) Material properties Viewer (camera) Lights
Slide 80OpenGL Primitives A triangle glBegin(GL_POLYGON); glVertex3f(0.0, 0.0, 0.0); glVertex3f(0.0, 1.0, 0.0); glVertext3f(0.0, 0.0, 1.0); glEnd(); Vertices determined between glBegin/glEnd pair Primitives incorporate polygons, lines, content, bends, surfaces
Slide 81OpenGL Camera OpenGL has an adaptable camera model Simple camera definition: gluLookAt(cop_x, cop_y, cop_z, at_x, at_y, at_z, â¦) glPerspective(field_of_view, â¦)
Slide 82Rendering pipeline Transformations Clipping Projection Ras