DOC PREVIEW
UCSD CSE 167 - Surfaces

This preview shows page 1-2-21-22 out of 22 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Introduction to Computer GraphicsFarhana Bandukwala, PhDLecture 11: SurfacesOutline• Linear approximation• Parametric bicubic surfaces• Subdividing surfaces• Drawing surfacesImplicit Representation• f(x,y,z)=0 describes a surface• Plane: ax+by+cz+d=0• Sphere: x2+y2+z2+r2=0• Divides 3-D space into points on or off surface• 3-D curve is represented as the intersection of two surfaces f(x,y,z)=0 and g(x,y,z)=0Linear approximation• Connected 3D polygons• Polygon defined by tangent planes at sampled pointsGood linear approximation needs several polygons at high curvature regionsParametric form• Each spatial variable expressed in terms of 2 independent variables• x = x(u,v) , y = y(u,v), z = z(u,v)• Locus of points p=[x(u,v) y(u,v) z(u,v)] for u=[umin,umax] & v=[vmin,vmax]• Derivative – (w/ respect to u) [dx(u,v)/du dy(u,v)/du dz(u,v)/du]– (w/ respect to v) [dx(u,v)/dv dy(u,v)/dv dz(u,v)/dv]Parametric bicubic surfaces• Generalization of cubic curves• Geometry vector is dependent on parameter v• For a specific v1, Qx(u,v1) is a curveu3u2u 1Gx0(v)Gx1(v)Gx2(v)Gx3(v)Matrix form: Qx(u,v1)=U*M*G(v1)* M *Example: Curves along parameter u=0.9000 0.7000 0.4500 0.2500 0.9000 0.7000 0.5000 0.3000 0.8000 0.6000 0.4000 0.2000 0.7000 0.5000 0.3000 0.1000 G x=0.1000 0.2000 0.3000 0.1000 0.2000 0.5000 0.6000 0.2000 0.1000 0.5000 0.7000 0.3000 0.2000 0.4000 0.5000 0.1000 G y=0.9300 0.9500 0.9100 0.9000 0.7000 0.5000 0.6000 0.7000 0.3000 0.3300 0.2500 0.3000 0.1000 0.1300 0.1500 0.1000 zGExample: Curves along parameter u&v=0.9000 0.7000 0.4500 0.2500 0.9000 0.7000 0.5000 0.3000 0.8000 0.6000 0.4000 0.2000 0.7000 0.5000 0.3000 0.1000 G x=0.1000 0.2000 0.3000 0.1000 0.2000 0.5000 0.6000 0.2000 0.1000 0.5000 0.7000 0.3000 0.2000 0.4000 0.5000 0.1000 G y=0.9300 0.9500 0.9100 0.9000 0.7000 0.5000 0.6000 0.7000 0.3000 0.3300 0.2500 0.3000 0.1000 0.1300 0.1500 0.1000 zGExample: Curves along parameter u&v=0.9000 0.7000 0.4500 0.2500 0.9000 0.7000 0.5000 0.3000 0.8000 0.6000 0.4000 0.2000 0.7000 0.5000 0.3000 0.1000 G x=0.1000 0.2000 0.3000 0.1000 0.2000 0.5000 0.6000 0.2000 0.1000 0.5000 0.7000 0.3000 0.2000 0.4000 0.5000 0.1000 G y=0.9300 0.9500 0.9100 0.9000 0.7000 0.5000 0.6000 0.7000 0.3000 0.3300 0.2500 0.3000 0.1000 0.1300 0.1500 0.1000 zGExample: Curves along parameter u&v=0.9000 0.7000 0.4500 0.2500 0.9000 0.7000 0.5000 0.3000 0.8000 0.6000 0.4000 0.2000 0.7000 0.5000 0.3000 0.1000 G x=0.1000 0.2000 0.3000 0.1000 0.2000 0.5000 0.6000 0.2000 0.1000 0.5000 0.7000 0.3000 0.2000 0.4000 0.5000 0.1000 G y=0.9300 0.9500 0.9100 0.9000 0.7000 0.5000 0.6000 0.7000 0.3000 0.3300 0.2500 0.3000 0.1000 0.1300 0.1500 0.1000 zGParametric bicubic surfaces (contd)Gi(v) = V*M*G where G = [gi1gi2gi3gi4] : constraints for cubic curve Using identity : (V*M*G)T= GT*MT*VTQx(u,v) = U * M ** MT* VT44434241343332312423222114131211ggggggggggggggggBezier Surfaces• Qx(u,v) = U * MB* G * MBT* VT• 4x4 Geometry matrix consists of respective component of 16 control points• C0 and G0 continuity by making 4 common control points between patches equal• G1 continuity when 2 sets of 4 control points on either side of edge are collinear P00P10P20P30P01P11P21P31P02P12P22P32P03P13P23P33P00P01P02P03uvP10P11P12P13P20P21P22P23P30P31P32P33Parameter space3-D Geometry spacexzyExample: Bezier surfaceSubdividing Surfaces• Split surface along one parameter, u– Curve subdivision method applied to each set of four control points along u– Stop subdividing when flatness test positive• Then subdivide over other parameter, v• New surface will consist of 4 patches• Problem: cracks can appear because different levels of subdivision at adjoining patches• Solution: subdivide over fixed depth at all patches regardless of flatness testDrawing Surfaces• Use recursive subdivision • Generalize curve subdivision to 2d• 1stsubdivide curves along u• 2ndsubdivide (new) curves along v• Draw polygons using :glBegin(GL_QUAD_STRIP)for all vertices in vi=[vmin-vmax-1]for all vertices in uj=[umin-umax]glVertex3f(xval(vi,uj),yval(vi,uj),zval(vi,uj))glVertex3f(xval(vj+1,uj),yval(vi +1,uj),zval(vi +1,uj))glEnd()P0P1P2P3L0= =R3.5(P1+P2)L1R2L2R1L3=R0Cross product• The cross product of 2 non-parallel vectors, is a vector orthogonal to the original 2.• To compute normal to plane containing original 2 vectors• Use cross product to compute normals to polygons• Use dot product to compute distance from plane/polygonuwvw = u x v = u2v3– u3v2u3v1– u1v3u1v2– u2v1Using evaluators in OpenGL• Beziers can be evaluated using OpenGL API• One dimensional evaluator– Setup curve mapping (glMap1f(GL_MAP1_VERTEX_3,umin,umax,stride,order,&ctrl_vector))– Enable evaluator (glEnable(GL_MAP1_VERTEX_3))– Evaluate vertices at appropriate parameter value (glEvalCoord1f(ui))• Two dimensional evaluator– Setup surface mapping (glMap2f(GL_MAP2_VERTEX_3,umin,umax,strideu,orderu, vmin,vmax,stridev,orderv,&ctrl_vector))– Enable evaluator (glEnable(GL_MAP2_VERTEX_3))– Evaluate vertices at appropriate parameter value (glEvalCoord2f(ui,vi))Hermite Surfaces• Completely defined by 4x4 geometry matrix GH• Px0(v) and P3x(v) define x components of starting and ending points of curve in parameter u• Rx0(v) and Rx3(v) are tangent vectors at these pointsu3u2u 1Px0(v)Px3(v)Rx0(v)Rx3(v)* MH*uvP0(v)P3(v)v=1.0v=0.0v=0.25v=0.5v=0.75Hermite Surfaces (contd)Suppose:P0x(v) = T * MH* g11g12g13g14xP3x(v) = T * MH* g21g22g23g24xR0x(v) = T * MH* g31g32g33g34xR3x(v) = T * MH* g41g42g43g44x)0,0(xv∂∂)0,0(x )1,0(x)1,0(xv∂∂)0,1(xv∂∂)0,1(x )1,1(x)1,1(xv∂∂)0,0(2xvu∂∂∂)0,0(xu∂∂)1,0(xu∂∂)1,0(2xvu∂∂∂)0,1(2xvu∂∂∂)0,1(xu∂∂)1,1(xu∂∂)1,1(2xvu∂∂∂GHx=x coordinates of 4 corners of patchx coordinates oftangent vector along vx coordinates oftangent vector along ux coordinates of partial derivative w/ respectto both parametersB-splines• Advantages over Beziers:• Local control of shape: one control point affects a portion of curve not the whole curve• Degree of


View Full Document

UCSD CSE 167 - Surfaces

Documents in this Course
Lighting

Lighting

38 pages

Review

Review

59 pages

Review

Review

110 pages

Midterm

Midterm

4 pages

Lighting

Lighting

38 pages

Lighting

Lighting

71 pages

Review

Review

110 pages

Lighting

Lighting

71 pages

Load more
Download Surfaces
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 Surfaces 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 Surfaces 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?