← Portfolio

Bezier Surfaces

Created, from scratch, a program that rendered vertex dumps as Bezier surfaces that where subdivided to create smooth surfaces.

Date: March 2014 Tech: C++, OpenGL Topics: Graphics, uniform subdivision, adaptive tessalation, Bezier surfaces
image-00.png image-12.png image-04.png image-02.png

Details

The goal was to take a given set of vertices, specified as a .obj or .bez file, and render it as an object via subdivision. Two subdivision techniques are supported: adaptive tessalation and uniform subdivision. Basically, the vertices specified by the input are grouped as control points for Bezier curves which are in turn grouped into Bezier surfaces. 4 control points specify a Bezier curve and 4 Bezier curves specify a Bezier surface.

The challenging part was making these surfaces look smooth and continuous. If we are given round, curve objects we should make it look smooth by breaking each Bezier surface into smaller Bezier surfaces. This is called subdivision. The more we subdivide the smoother and prettier the rendered object is. The catch is that the more we subdivide the more expensive it becomes (exponential, actually). The two techniques we used were:

  • Uniform subdivision: break surfaces into same size patches regardless input curvature, basically split the object into a mesh/grid-like fashion
  • Adaptive tessalation: recursively break surfaces into smaller and smaller triangles untill the each triangle passes the flatness test (flatness testing is to ensure there is no cracking between adjacent surfaces)
image-09.png image-10.png image-11.png