CSC 220 3D Computer Graphics Fall 2003Graphics HardwareColor for Computer GraphicsGraphics SoftwareGraphics File FormatsThe Graphics PipelineModeling TechniquesSlide 8Teddy – a Modeling AppletTERASome Visual CuesSurface AlgorithmsSome Minimal MathematicsThe Z-buffer MethodPOV-RaySpecifying an Image in SDLSimple ShapesConstructive Solid GeometryTransformation of CoordinatesZ-Buffer ShadingLights in POV-RayReflected LightRay Tracer Shading2D Texture Mapping3D Texture MappingViewing – the Synthetic CameraLight and its PerceptionThe Human EyeThe Color CubesThe HSV Color SystemHalftoningSome Advanced ShapesNURBSThe Rhino InterfaceViewing in RhinoDrawing LinesModeling AidsEditing ObjectsRhino GeometryCreating CurvesCreating SurfacesCreating SolidsTechnical Side of AnimationArtistic Side of AnimationCSC 220 3D Computer Graphics Fall 2003Graphics HardwareText Mode – Characters (2K bytes)Graphics Modes – Pixels (millions of bytes) x-y coordinate systemRaster Scan with Frame Buffer (aliasing)Vector Scan with Display ListColor for Computer GraphicsRed, Green, Blue phosphors and shadow maskVGA – 640 x 480 with 16 colorsVGA – 320 x 200 with 256 colors, using the Color LookUp Table (CLUT) – 8 bits / pixel is 256 colors at one time, but 262,144 colors in paletteSVGA with True Color – 800 x 600 (or more), using 24 bits / pixel – millions of colors simultaneouslyGraphics SoftwareBASIC is an exceptionAPI’s, or librariesBorland Graphical Interface (BGI)Graphical Kernel System (GKS)OpenGL …Graphics File FormatsGIFJPEGBMPTIFFTarga…The Graphics PipelineModeling – geometry of an objectViewing – how the object appearshidden surfacessynthetic cameraRendering – realism and morelightingshadingtexturesshadowsModeling TechniquesPolygons (Triangles)Splines (NURBS)Constructive Solid Geometry (CSG)Fractals …Teddy – a Modeling AppletSimple and quickFor rough models instantlySpherical topologyOperationscreationextrusioncuttingbendingTERAA tool for visual literacyCan display 500,000 combinations of images rendered by various methodsCan be used in two waysexplore rendering effectsself-test rendering effectsContains POV-Ray files alsoSome Visual CuesVisibilityShadowsReflectionsRefractionSurface AlgorithmsVisibilitywireframe – ambiguityhidden lines / surfacesRendering techniques (2 of many)z-bufferray tracingSome Minimal Mathematics3D coordinates – x,y,z as LHSVectors – direction and magnitudeNormal vector to a surfaceCulling back facesThe Z-buffer MethodAlong with frame buffer have a z-buffer:Frame buffer holds color value for the pixelZ-buffer holds z value for the pixel location Scan each surface in succession. If z value for this location on this surface is less than value in z-buffer, replace color in frame buffer and update value in z-bufferMost common rendering method, often with special hardwarePOV-Ray No modeling, uses Scene Description Language (SDL)Does viewing and renderingNo books in print, but excellent on-line documentationExercises from TERA textrender gold.pov, p.9render room.pov, p.20revise camera orientation of room, pp.21,22Specifying an Image in SDLObjectsSimple shapesCSG objectsAdvanced shapesTransformationsTextureCameraLightingSimple ShapesSpheresBoxesConesCylindersPlanesConstructive Solid GeometryUnionIntersectionDifferenceMergeTransformation of CoordinatesAffine transformations translation scaling rotationComposition of affine transformationsProperties of affine transformationsstraight lines stay straightparallel lines stay parallelangles do NOT stay fixed, except for rigid transformations (no scaling)Z-Buffer ShadingConstant Shading – color computed once for entire objectFaceted Shading – color computed once for each polygonGouraud Shading – color computed using vertex normal, then double interpolation of color values in the polygonPhong Shading – double interpolation of vertex normals, then color value computed for each interpolated vector value in the polygonLights in POV-RayPoint lightsSpotlightsradiusfallofftightnessadaptivejitterCylinder lights (same parameters as spotlight)Area lightsAmbient lightingReflected LightWhen light strikes a surface, some colors are absorbed, and we see the colors that are reflected.We deal with three types of reflections:ambient reflected lightdiffuse reflected lightspecular reflected light (Phong illumination) Computing the reflected values requires that vectors must be multiplied.Ray Tracer ShadingMultiple reflectionsTransparencyRefractionShadows2D Texture MappingMap Types planar – normal parallel to X, Y, or Z cylindrical – rotation around X, Y, or Z spherical – rotation around X, Y, or Z box – normal parallel to X, Y, or ZProblems poles distortion aliasingBilateral symmetry and planar maps3D Texture MappingProcedural – texture is function f(x,y,z)Common textures are stripes, rings, rampsNoise for realistic effects amplitude frequency use of higher order terms eccentricity, tilt, and twistTexture functions in POV-Ray for glass, metal, stone, and woodViewing – the Synthetic CameraWorld Coordinates (WC) – x,y,zr is location of camera in WCThe View Plane – U,V,NN is where camera is lookingV is up direction, orthogonal to NU is 3rd axis, orthogonal to both N and VLight and its PerceptionIn describing the effects of light we must take into account both physics and physiology.The wavelength of visible light varies from 400 nanometers (violet) to 700 nanometers (red).In describing the quality of light, we need three parameters: hue – the dominant wavelength intensity (physics) or brightness (physiology) saturation – the purity of the hueThe Human EyeThe eye has rods that are very sensitive to light versus dark (about 1 photon), and cones that are less sensitive to level (about 5 photons) but can distinguish colors.There are cones sensitive to blue, to green, and to red. They are all in the fovea (1/4 mm), and are the basis of the tristimulus theory of vision. Light which is a mixture of red and green looks just as yellow as does pure yellow light! The human visual system cannot detect overtones and harmonics as does the human auditory system.The Color
View Full Document