hearn,baker - computer graphics - c version 2nd ed

Mixed newquadtree status mixed octreetoquadrree back

This preview shows page 497 - 499 out of 662 pages.

mixed */ newquadtree->status = MIXED; octreeToQuadrree (back, newQuadtree); octreeToQuadtree (front, nemuadtree): ) krtion 13-10 Raycasting Method 13-1 0 RAY-CASTING METHOD If we consider the line of sight from a pixel position on the view plane through a scene, as in Fig. 13-26, we can determine which objects in the scene (if any) inter- sect this line. After calculating all raysurface intersections, we identify the visi- ble surface as the one whose intersection point is closest to the pixel. This visibil- itydetection scheme uses ray-casting procedures that were introduced in Section 10-15. Ray casting, as a visibilitydetection tool, is based on geometric optics methods, which trace the paths of light rays. Since there are an infinite number of light rays in a scene and we are interested only in those rays that pass through Figure 13-26 A ray along the line of sight from a pixel position through a scene.
Image of page 497

Subscribe to view the full document.

Chapter 13 pixel positions, we can trace the light-ray paths backward from the pixels visible-Surface Detection Merhcds through the scene. The ray-casting approach is an effective visibility-detection method for scenes with curved surfaces, particularly spheres. We can think of ray casting as a variation on the depth-buffer method (Sec- tion 13-3). In the depth-buffer algorithm, we process surfaces one at a time and calculate depth values for all projection points over the surface. The calculated surface depths are then compared to previously stored depths to determine visi- ble surfaces at each pixel. In rayxasting, we process pixels one at a time and cal- culate depths for all surfaces along the projection path to that pixel. Ray casting is a special case of ray-tracing algorithms (Section 14-6) that trace multiple ray paths to pick up global reflection and refraction contributions from multiple objects in a scene. With ray casting, we only follow a ray out from each pixel to the nearest object. Efficient ray-surface intersection calculations have been developed for common objects, particularly spheres, and we discuss these intersection methods in detail in Chapter 14. 13-1 1 CURVED SURFACES Effective methods for determining visibilit$ for objects with curved surfaces in- clude ray-casting and octree methods. With ray casting, we calculate raysurface intersections and locate the smallest intersection distance along the pixel ray. With octreff, once the representation has been established from the input defini- tion of the objects, all visible surfaces are identified with the same processing pro- cedures. No special considerations need be given to different kinds of curved surfaces. We can also approximate a curved surface as a set of plane, polygon sur- faces. In the list of surfaces, we then replace each curved surface with a polygon mesh and use one of the other hidden-surface methods previously discussed.
Image of page 498
Image of page 499

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern