![]() Of course, the more iterations one uses the more vertices one must deal with: in the bottom case below (six iterations) there is nearly 100,000 quads to render: a bit overkill but a lesson in how the algorithm subdivides.Hello Triangle Getting-started/Hello-Triangle Its impressive to see the subdivision in action - after only 2 iterations the cube corners were smoothed to nearly a sphere (see top right image below), a few more iterations of Catmull Clark results in a shape approximate to a sphere (see bottom image below). As a test case for proper algorithm implementation, I used the classic demonstration of Catmull Clark: begin with a cube and visualize each iteration of the smoothing, the results of which should smooth the cube down to nearly a sphere. The algorithm itself is fairly straightforward - given the polygons I was dealing with I was forced to use a series of hash tables (HashMap) to keep track of vertices and their shared edges/polygons. To see Catmull Clark in action I implemented the algorithm in java 2, using OpenGL via JOGL for visualization. The newly created primitives together will generally look smoother than the previous mesh, and recursive/iterative application results in further smoothing of the overall mesh shape. It should be noted that other properties of a vertex - for instance the vertex surface normal - can be calculated in a similar manner.Construct the new mesh subdivision quadrangles by connecting the newly created edge and face points together with the old, repositioned vertex.Where n is the number of face points (should be equal to the number of edge points). The weighted average abides by the formula: For 3-dimensions, this is simply averaging the x/y/z values of each vertex.įor each edge, calculate the edge points - an edge point is the average of both the end point vertices and the face points of the faces sharing said edge.įor each vertex v of the polygon P, adjust its 3-dimensional coordinates by using the weighted average of the a) edge points R of the edges containing the vertex v and b) the face points F of the polygon/faces containing v and c) the previous values of the vertex v. For each polygon - or face - P with vertices V in the mesh:Ĭalculate the Face Point - the average of all vertices of the polygon face. The technique for Catmull Clark starts with a list - or mesh - of input polygons. Thus, the application of the algorithm can be useful in all sorts of rendering scenarios, from science to games to animated movies. Named in part after Edwin Catmull, currently the president of Pixar, the subdivision technique has been used in animations such as A Bug's Life, Finding Nemo, and The Incredibles 1. The Catmull Clark algorithm is fast and effective, and even capable of smoothing a cube down to a sphere (see below). The method takes each primitive polygon contained in the mesh and divides the polygon into quadrilaterals, constructing new vertices based upon the averages and adjusting the previous vertices of the original polygon based upon the surrounding environment. Catmull-Clark subdivision is a method to smooth a 3-dimensional polygon mesh surface by dividing the surface's polygons into smaller polygons, repositioning the previous vertices based upon adjacent vertices.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |