Unformatted text preview:

Lecture 19: Surfaces II -- Simple SurfacesHe hath put down the mighty from their seats, and exalted them of low degree. Luke 1:521. Simple SurfacesSome surfaces are easy to describe without equations. A sphere is the locus of points at a fixed distance from a given point; a cylinder is the locus of points at a fixed distance from a given line. Thus a sphere can be represented simply by a center point and a radius; a cylinder by an axis line and a radius. For these simple surfaces, we shall see that we can compute surface normals and ray-surface intersections directly from their geometry, without resorting to implicit or parametric equations. Thus ray tracing these surfaces is particularly easy. In this lecture we will investigate ray tracing strategies for surfaces defined geometrically rather than algebraically. These surfaces include the plane and the natural quadrics -- the sphere, the right circular cylinder, and the right circular cone. We shall also explore ray tracing for general quadric (second degree) surfaces as well as for the torus, which is a surface of degree four. General surfaces of revolution will also be investigated here. These surfaces are among the simplest and most common surfaces in Computer Graphics, so they deserve special attention.2. Intersection StrategiesSpecial strategies exist for ray tracing simple surfaces. One of the most common tactics is to apply a transformation to reduce the ray-surface intersection problem to a simpler problem either by projecting to a lower dimension, or by repositioning to a canonical location, or by rescaling to a symmetric shape.Consider intersecting a curve € C and a surface € S. If a point P lies on the intersection of the curve C and the surface S, then for any affine or projective transformation M the point € P ∗ M lies on the intersection of the curve € C ∗ M and the surface € S ∗ M. If the transformation M is cleverly chosen, in many cases it is easier to intersect the curve € C ∗ M with the surface € S ∗ M rather than the original curve C with the original surface S. Moreover, if the transformation M is invertible, then € P ∈ C ∩ S ⇔ P ∗ M ∈ C ∗ M ∩ S ∗ M.Therefore, when M is invertible, we can find the intersection points of the the original curve C and the original surface S by computing the intersection points of the transformed curve € C ∗ M with the transformed surface € S ∗ M and then mapping back by € M−1. This method is essentially the deformation technique discussed in the previous lecture, though M may also be a rigid motion as well as a shear or a scale.But what if the transformation M is not invertible? For example, what if M is an orthogonal or perspective projection? Remarkably, for parametric curves and surfaces the same strategy can still work.Consider intersecting a parametric curve € C = C(t) and a parametric surface € S = S(u,v). The curve C and the surface S intersect whenever there are parameter values € t*,u*,v * for which€ C(t*) = S(u*,v*).Applying an affine or projective transformation M yields€ C(t*) ∗ M = S(u*,v*) ∗ M.Thus if the original curve and surface intersect at the parameters € t*,u*,v *, so will the transformed curve and surface. The intersection points may change, but the parameter values are unaffected. This observation is the key to our intersection strategy.If no new intersection points are introduced by applying the transformation M, then we can find the intersection points of the original curve and surface by solving for the parameters € t * or € (u*,v*) of the intersection points of the transformed curve and surface and then substituting these parameter values back into the original parametric equations € C = C(t∗) or € S = S(u∗,v∗) to find the intersection points of the original curve and surface. Moreover, even if we do introduce some new spurious intersection points by applying a singular transformation, we never lose any of the old intersection points. So, at worst, we would need to check whether the parameters representing intersection points on the transformed curve and surface also represent intersection points on the original curve and surface. But we can always verify potential intersections by substituting the intersection parameters back into the parametric equations of the original curve and surface and checking whether or not we get the same point on the curve and the surface -- that is, by verifying that € C(t*) = S(u*,v*). We shall see many examples of this general transformation strategy for computing intersections throughout this lecture.3. Planes and PolygonsA plane can be described by a single point Q on the plane and a unit vector N normal to the plane. A point P lies on the plane if and only if the vector € P − Q is perpendicular to the normal vector N or equivalently if and only if € N • (P − Q) = 0.A line € L(t) = P + t v intersects the plane determined by the point Q and the normal vector N at the parameter value € t *, where€ N • L(t*) − Q( )= N • P + t *v −Q( )= 0.2If € N • v = 0, then the line is parallel to the plane, so the line and plane do not intersect. Otherwise, solving for the parameter € t * yields€ t* =N • Q− P( )N • v. (3.1)Substituting the parameter € t * back into the equation of the line, we find the intersection point€ R = L(t*) = P + t *v. (3.2)Thus we have a simple algorithm to intersect a line with an infinite plane.Often, however, we want to find the intersection of a line with a finite polygon, rather than with an infinite plane. For example, when we ray trace a cube, the faces of the cube are squares, not infinite planes. Even if a line intersects the plane containing the polygon, the line might not intersect the plane at a point inside the polygon.For convex polygons like triangles and rectangles, there is a straightforward test for determining if a point R on a plane of the polygon lies inside the polygon. Consider a closed convex polygon with vertices € Pi, € i = 1,K,m + 1, where € Pm+1= P1. Let € Ni,i+1 be the vector normal to the edge € PiPi +1 and pointing into the polygon (see Figure 1).€ P1€ P2€ P3€ P4€ P5€ •€ •€ •€ •€ •€ •€ R€ N12€ N23€


View Full Document

Rice COMP 360 - Lecture Notes

Documents in this Course
Radiosity

Radiosity

42 pages

Radiosity

Radiosity

22 pages

Load more
Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?