![]()
|
![]() Teaching and Learning Computer Graphics Made Easy with GraphicsMentor Ching-Kuang Shene, Michigan Technological University Abstract 1. Motivation To address these and other problems, we developed GraphicsMentor, a pedagogical tool, written in C/C++, OpenGL and GLUT, for Linux, SGI IRIX, Sun Solaris, and Windows systems. It allows a student to alter virtually every parameter of the camera, light source and object material property, and visualize the result on-the-fly. A limited keyframe animation capability is also available. Because of its flexibility and interactive nature, GraphicsMentor can help students learn graphics fundamentals easily and quickly. Hence, GraphicsMentor may be used in a computer-equipped classroom or in a lab for students to practice and experiment with various concepts and for an instructor to demonstrate the effect of changing graphics parameters. There are three major reasons for us to develop GraphicsMentor even though there are many high power systems available (e.g., trueSpace, LightWave 3D, 3D Studio Max and Maya) that support all features of GraphicsMentor. The first and the most important reason is cost. GraphicsMentor is designed to be pedagogical and is free for students and instructors to run on popular systems with minimal hardware requirement. Commercial professional systems cost a few hundred to several thousand dollars per copy and, as a result, they are not very cost effective. Worse, many of them can only function properly with a hardware lock in place, and the cost for a replacement if the lock is stolen is as high as purchasing a new copy. Second, due to its pedagogical nature, the use of GraphicsMentor is straightforward, whereas commercial professional systems usually have very steep learning curve because of their power and complex menu systems. Third, allowing students to redesign and/or modify various components of GraphicsMentor for supporting graphics programming has been one of our major goals. This support is similar to many pedagogical tools that are being used in other courses (e.g., Nachos for operating systems). However, such programming support is virtually impossible with commercial professional systems. This paper briefly reviews GraphicsMentor and presents its possible classroom uses. The interested readers may refer to (Lowther and Shene, 2000; Lowther and Shene, 2001; Shene 2002) for a detailed discussion of related work. 2. The Environment
|
![]()
|
![]() |
![]() ![]() |
![]() |
![]() |
![]() ![]() |
![]() |
![]() |
![]() The default color of an object is always mid gray. The top four slides in the Object Modification window are used for changing the RGB color components and alpha channel, and this change can be applied to the ambient, diffuse, and specular components of the object's material property. The fifth slide is used for selecting the shininess of the object. Moreover, a student can left-drag and right-drag in the Canvas window to perform translation and trackball type rotation, respectively. With these capabilities, a student can quickly grasp the impact of different ambient and diffuse values on rendered shapes. In fact, it is easy to place a number of spheres in the scene, each of which has a different combination of ambient and diffuse values, and observe the differences among the rendered results. Figure 3 is such an example. The spheres on the first, second and third rows have ambient values 0.6, 0.4 and 0.2, and the spheres on the first, second and third columns have diffuse values 0.2, 0.5 and 0.8. |
![]() |
![]() |
![]() ![]() |
(a) Canvas view |
![]() |
![]() |
![]() |
![]() |
![]() ![]() |
|
![]() |
4. The Camera |
![]()
|
![]() |
![]() ![]() |
|
![]() |
![]() The first slide of the Camera Manipulation window is used for changing the view angle, which mimics zooming. The second slide is for changing the aspect ratio of the view volume; however, since the Camera View window has an aspect ratio of 1:1, altering the aspect ratio changes the aspect ratio of the view volume only and distorted objects may occur in the Camera View window. The last two slides are for changing the positions of the near and far clipping planes. GraphicsMentor does not allow these two planes to cross each other. To change camera orientation, a student may left-drag the two perpendicular (i.e., the right and up) vectors in the small window in the lower-right corner of the Camera Manipulation window. Figure 6(a) shows a view volume with the near clipping plane close to the camera. The far clipping plane cuts part of the sphere off; however, this cannot be seen because the front side is not transparent. If we move the near clipping plane towards the sphere as shown in Figure 7, the Camera View window shows a clipped sphere. Through the front hole, one can see that the back-end is also clipped. |
![]() |
![]() |
![]() ![]() |
![]() |
![]() |
![]() ![]() |
![]() |
![]() |
5. Lights, Please! |
![]() |
![]() |
![]() ![]() |
![]() |
![]() |
![]() GraphicsMentor supports two types of light source, point light (default) and spot light. A point light is represented by a dot in all four subwindows and shown in the color of the light. Except for the default light 0, whose initial position is above the coordinate origin, all other lights have their initial positions at the origin. A click on the Modify button of the Light List window brings up a light window of the selected light (Figure 9(a)). The bottom part of this window shows the name, color and coordinates (i.e., position) of the light being modified. The upper-right corner buttons permit a student to switch between point light and spot light. The top three slides control the RGB components of the light color, and the three buttons to the right of the slides allow a student to choose one of the ambient, diffuse, and specular components to modify. |
![]() |
![]() |
![]() ![]() |
|
![]() |
![]() Once a light is selected, a student can left-drag it to a new position in any side-view subwindow. Thus, combined with the camera and material property of each object, a student can experiment and verify many important concepts and effects of an illumination/lighting model. A must-show example illustrates two of the most important drawbacks of local illumination models: no shadows and non-blocking light. Figure 9(b) shows a big yellow oblate ellipsoid between the light source (i.e., the white dot) and a small red sphere. Note that the light source is very close to the oblate ellipsoid. It is clear that the light cannot illuminate the sphere in reality; however, the image clearly shows that the portion of the red sphere facing the light is illuminated and the oblate ellipsoid casts no shadow on the red sphere! GraphicsMentor also supports spot lights. A click on the Modify button of a light source brings up its light window. Then, click on the Spot Light button of the selected light window changes the light to a spot light (Figure 10(a)). In fact, the spot light window is identical to the point light version, except that there are five more slides for modifying the characteristics of a spot light. The spot light icon, as shown in the Canvas window, is a dot with a cone attached shown in the color of the light. A student may left-drag the spot light icon to change its position, and right-drag to modify the light direction. The top three slides are for modifying the coefficients kc, kl and kq of the attenuation factor, which is the reciprocal of kc + kl d + kq d2, where d is the distance between an object and a spot light. The Spot Exponent slide controls the concentration of the spot light, and the Cutoff Angle slide controls the spot light cone angle. |
![]() |
![]() |
![]() ![]() |
|
![]() |
![]() An interesting experiment for students to do is to visualize a mix of colored lights (Figure 10(b)). A thin white box is placed in the scene along with three spot lights with colors red, green and blue, respectively, each of which has a small cutoff angle so that it can only illuminate the vicinity of the coordinate origin. The camera is placed above the origin. A student can choose different position, color, cutoff angle, spot exponent of a spot light to generate different effects. In this way, an instructor may be able to cover some color models easily. GraphicsMentor is also useful in helping students visualize other shortcomings of local illumination models. An oblate ellipsoid with coarse triangulation (for demonstrating the relationship between coarse triangulation and spot light) is placed in the scene (Figure 11(a)). There are two lights. The top one is a spot light of white color, placed close enough to the surface so that its light cone only covers a portion of the surface. The bottom one is a mid gray point light for illuminating the bottom part of the surface. The camera is placed above the surface. Because the triangulation is coarse, the spot light does not shed a circular shape on the surface. Instead, the shape is a polygon whose shape depends on the way of triangulating the surface. See the top view and world view subwindows. The silhouette of the surface in the Camera View window is barely seen, and the spot light generates a hexagonal illuminated area on the surface. The Mach band effect is clearly seen! |
![]() |
![]() |
![]() ![]() |
![]() |
![]() ![]() |
![]() |
![]() |
![]() Figure 13 shows a simple example. Three spheres, in yellow, red, and blue, rotate about the origin with camera pointing downward. Eight keyframes are recorded as shown. The yellow sphere rotates about 130 degree, the red one rotates about 180 degree and is a little faster, and the blue one rotates about 360 degree and is the fastest moving object. After all eight keyframes are recorded and click on the Play button, GraphicsMentor generates intermediate frames and plays the animation smoothly. |
![]() |
![]() ![]() |
![]() |
![]() |
![]() ![]() |
![]() |
![]() |
![]() Another popular global illumination model is radiosity, which is based on the theory of heat transfer (Cohen & Wallace, 1993; Sillion & Puech, 1994). Radiosity can produce indirect illumination, color bleeding, soft shadows and very realistic looking images. However, in addition to being very time consuming, radiosity cannot handle reflection and refraction and every object must be triangulated. Note that radiosity may be incorporated into a ray tracing system (Larson and Shakespeare, 1997; POV-Ray, 2002). Photon mapping is a very interesting approach developed in recent years that is efficient and capable of producing radiosity effects along with others (Jensen, 2001). With photon mapping, photons are shot from each light source and reflected from the hit objects until the energy diminishes to zero or the level of reflection reaches a pre-specified limit. Therefore, each photon carries the color and intensity of a light source and the color at the point of a hit object to other objects. This information is stored in a data structure called photon-map and is used to modify the ray traced result. In this way, photon mapping is able to generate many radiosity effects (e.g., color bleeding and soft shadow) and retain the advantages of ray tracing (e.g., reflection and refraction). Moreover, photon-mapping is also capable of creating some effects which are very difficult to do with ray tracing and radiosity (e.g., caustics). Figure 15 shows the effect of adding photon mapping to the scene in Figure 14(a). This image clearly shows some radiosity effects of color bleeding, indirect illumination of the ceiling, and soft shadows. |
![]() |
![]() |
![]() ![]() |
![]() |
![]() |
![]() ![]() 11. References Glassner, A. S. editor (1989). An Introduction to Ray Tracing, Academic Press. Jensen, H. W. (2001). Realistic Image Synthesis Using Photon Mappings, A K Peters. Larson, G. W. and Shakespeare, R. (1997). Rendering with Radiance, Morgan Kaufmann. Lowther, J. and Shene, C.-K. (2000). Rendering + Modeling + Animation + Postprocessing = Computer Graphics, The Journal of Computing in Small Colleges, 16 (1), 20-28. Reprinted in Computer Graphics, 34 (4), 15--18. Lowther, J. and Shene, C.-K. (2001). Computing with Geometry as an Undergraduate Course: A Three-Year Experience, ACM 32nd SIGCSE Technical Symposium, February 21-25, 2001, 119-123. Nikolic, D. and Shene, C.-K. (2002). GraphicsMentor: A Tool for Learning Graphics Fundamentals, ACM 33rd SIGCSE Technical Symposium, February 27 – March 3, 2002, 242-246. POV-Ray (2002). Persistent of Vision - ray tracing system. Available free at http://www.povray.org/. Shene, C.-K. (2002). Raytracing as a Tool for Learning Computer Graphics, to appear in ASEE/IEEE Frontiers in Education, November, 2002. Shirley, P. (2000). Realistic Ray Tracing, A K Peters. Sillion, F. X. and Puech, C. (1994). Radiosity and Global Illumination, Morgan Kaufmann. |
|
![]() |
|
![]() |