Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating Meshes Through Parameterized Functions

Similar presentations


Presentation on theme: "Creating Meshes Through Parameterized Functions"— Presentation transcript:

1 Creating Meshes Through Parameterized Functions
Lecture 26 Mon, Oct 29, 2007

2 Surfaces Defined by Functions
Let F(x, y, z) = 0 be an equation that implicitly defines a 2-dimensional surface in 3-dimensional space. For example, x2 + y2 + z2 – 1 = 0 defines a sphere. x2 + y2 – z2 = 0 defines a cone.

3 Parameterizing the Surface
Often the surface can be parameterized in terms of two parameters s and t, based on some intrinsic properties of the surface. Let x, y, and z be given in terms of s and t, with a  s  b, c  t  d. x = x(s, t) y = y(s, t) z = z(s, t) Often [a, b] and [c, d] are [0, 1] or [0, 2].

4 Parameterizing the Surface
Then P(s, t) = (x, y, z) is a point on the surface.

5 Example: A Sphere of Radius 1
Use spherical coordinates, where s is the angle around the vertical axis (longitude), t is the angle up from the equator (latitude). Then let x = cos t cos s, y = cos t sin s. z = sin t, with 0  s  2 and -/2  t  /2.

6 Example: A Sphere of Radius 1
Then P(s, t) = (cos t cos s, cos t sin s, sin t) is a point on the surface. Check: x2 + y2 + z2 – 1 = cos2 t cos2 s + cos2 t sin2 s + sin2 t – 1, = cos2 t + sin2 t – 1, = 0.

7 A Spherical Mesh Read Run

8 Example: A Cone of Radius 1 and Height 1
To define the surface of a cone, let x = t cos s y = t sin s z = t with 0  s  2 and 0  t  1. s represents an angle around the central axis. t represents the height and the radius of a horizontal cross-section

9 Example: A Cone of Radius 1 and Height 1
Then s represents an angle around the central axis. t represents the height and the radius of a horizontal cross-section Then P(s, t) = (t cos s, t sin s, t) is a point on the surface of the cone. Check: x2 + y2 – z2 = t2 cos2 s + t2 sin2 s – t2 = 0.

10 Contours An s-contour is the 1-dimensional curve we get if we hold t fixed and let s vary. A t-contour is the 1-dimensional curve we get if we hold s fixed and let t vary. Typically, we get a different s-contour for each value of t and a different t-contour for each value of s.

11 Example: Contours on a Cone
Let t = ½. Then x = ½ cos s, y = ½ sin s, z = ½. The s-contour is the curve x2 + y2 = ¼ which is a circle of radius ½. This is a slice of the cone parallel to the base.

12 Example: Contours of a Cone

13 Example: Contours of a Cone
Let s = /2. Then x = 0, y = t, z = t. The t-contour is the curve y = z which is a straight line. This is a slice of the cone perpendicular to the base.

14 Example: Contours of a Cone

15 A Conical Mesh Read Run

16 Finding Normal Vectors
At a point P(s, t), The tangent to the s-contour is given by P/s. The tangent to the t-contour is given by P/t. Thus, the unit normal to the surface is n = (P/s)  (P/t), normalized.

17 Example: Finding Normals
Find the normals to the surface of the cone defined by x2 + y2 = z2. Let P(s, t) = (t cos s, t sin s, t). P/s = (-t sin s, t cos s, 0). P/t = (cos s, sin s, 1). N = (t cos s, t sin s, -t). Normalize to n = (cos s, sin s, -1)/2.

18 The Direction of the Normals
Caution: This proceed is as likely to produce vectors that point “inward” as it is to produce vectors that point “outward.” If the vectors point inward, then attach a negative sign to each component to reverse the direction.

19 The Toroidal Mesh Read Run

20 The Cylindrical Mesh Read Run

21 Several Meshes in a Scene
Read Run

22 A Snowman Read Run

23 A Lamp and Lampshade

24 The Mesh Class mesh.h mesh.cpp


Download ppt "Creating Meshes Through Parameterized Functions"

Similar presentations


Ads by Google