Examples for Assignment 2

Note: You can hover on any image to see the original high resolution version.

Rotation

 rotate( mesh, rotate )
Rotates a mesh ( or a selected part ) around an axis by number specified in the sliders. The unit used for rotation is radians.
rotate_1.png
cube.obj rotateX -0.8
rotate_2.png
cube.obj (selection) rotateX -0.8

Twist

 twist( mesh, factor )
Rotates all vertices v along the Y axis by v.position.y * factor. The units are again radians.
twist_1.png
large_cube.obj twist 1
twist_2.png
large_cube.obj twist 2

Inflate

 inflate( mesh, factor )
Moves all vertices in the direction of their respective vertex normals, proportional to a factor. For the cube, this operation will give a scaling effect.
inflate_1.png
cube.obj inflate -1
inflate_2.png
cube.obj inflate 1
inflate_4.png
hand.obj inflate -0.1
inflate_3.png
hand.obj inflate 0.1
It is possible to augment this operation by averageEdgeLength. This will give nicer results for the inflated hand - the creases are better preserved, and the inflate operation is now aware of the mesh scale.
inflate_factor_1.png
cube.obj inflate -1
inflate_factor_2.png
cube.obj inflate 1
inflate_factor_4.png
hand.obj inflate -1
inflate_factor_3.png
hand.obj inflate 1

Noise

 twist( mesh, factor )
Moves all vertices in the direction of their respective vertex normals, proportional to mesh.averageEdgeLength(v) * factor * randomIn( -1, 1 ).
noise_2.png
large_cube.obj noise 0.5
noise_1.png
large_cube.obj noise 1

Smooth

 smooth( mesh, iter )
This operation needs to be applied iter number of times. For each iteration, the vertices should be moved to the weighted average of itself and its neighbors. Be careful when updating the position. During a single iteration you want to use original positions throughout the entire computation. Update the actual positions of the vertices only after all new locations have been calculated.
smooth_gauss_1.png
large_cube.obj smooth 1
smooth_gauss_2.png
large_cube.obj smooth 10
smooth_gauss_4.png
cheetah.obj smooth 1
smooth_gauss_3.png
cheetah.obj smooth 10

Sharpen

 sharpen( mesh, iter )
This operation needs to be applied iter number of times, similarly to smooth. If you are having display issues consider checking triangulate. ( Assuming you have implemented the triangulate filter )
sharpen_1.png
cheetah.obj sharpen 0
sharpen_2.png
cheetah.obj sharpen 1
sharpen_3.png
cheetah.obj sharpen 2
sharpen_4.png
cheetah.obj sharpen 3

Curvature

 curvature( mesh )
Depending on your choice of visualization, your results might vary greatly from this. However for the cheetah, what you should be seeing is high curvature values (bright yellow in our visualization) in places like the claws, nostrils or ears, and low curvature values (blue in our visualization) around the claws. This is due to the fact that Gaussian curvature is defined as product of principal curvatures. Your final colors will vary depending on what method you use to map the curvature to a suitable range for the colors. Notice that for the cube, all the vertices have the same value so they are all mapped to mid gray.
curvature_1.png
cube.obj curvature
curvature_2.png
cheetah.obj curvature
curvature_3.png
cow.obj curvature

Truncate

 truncate( mesh, factor )
Creates an effect where each vertex is "cut off". It is possible to accomplish this using the splitEdge() and splitFace() functions. Topologically we are only adding vertices, so there is no need to remove any vertices. Think about the necessary topological and geometrical changes.
truncate_1.png
cube.obj truncate 0.2
truncate_2.png
cube.obj truncate 0.4
truncate_3.png
cube.obj (selected) truncate 0.4

Extrude

 extrude( mesh, factor )
The vertices of each face should be duplicated and moved along the normal of the face. The original face should be attached to the duplicated vertices. The set of original vertices and duplicated vertices should be connected together by new faces. This feature requires you to modify the half edge data structure by using the splitFaceMakeEdge(...), joinEdgeKillVertex( v1, v2, v3 ), and splitEdgeMakeVertex( v1, v2, f ) functions. Make sure you familiarize yourself with these functions before starting to code this one!
extrude_1.png
cube.obj extrude 1
extrude_2.png
cube.obj (selected) extrude 1

Bevel

 bevel( mesh, factor )
Creates the effect where each edge is "cut off". Please refer to the precept 5 slides for some tips on implementing this feature.
bevel_1.png
cube.obj bevel 0.2
bevel_3.png
dodacahedron.obj bevel 0.2
bevel_5.png
tetrahedron.obj bevel 0.2
bevel_2.png
cube.obj bevel 0.2
bevel_4.png
dodacahedron.obj bevel 0.2
bevel_5.png
tetrahedron.obj bevel 0.2

Split Long Edges

 splitLong( mesh, factor )
Splits the longest edge in the mesh. Depending on the choice of which vertices you selected to connect to a newly created one, you can obtain different results. Notice that as you go through the iterations one of the newly added edges might be the longest one.
split_long_1
cube.obj splitLong 0.1
split_long_2
cube.obj splitLong 0.5
split_long_3
cube.obj splitLong 1.0

Triangle Topology

 triSubdiv( mesh, levels )
Splits each face into triangles. This effect is applied levels number of times. The mesh should be triangulated before using this function. In the example images, the input tetrahedron has been scaled (5) and rotated (1.57) for visualization purposes.
triangle_1.png
tetrahedron.obj triSubdiv 1
triangle_2.png
tetrahedron.obj triSubdiv 3

Loop Subdivision

 loop( mesh, levels )
Splits each face into triangles. This effect is applied levels number of times. The mesh should be triangulated before using this function. In the example images, the input tetrahedron has been scaled (10) and rotated (1.57) for visualization purposes. In these examples, we have used Warren weights.
loop_2
tetrahedron.obj triSubdiv 1
loop_3
tetrahedron.obj triSubdiv 3
loop_7
cheetah.obj triSubdiv 1
loop_8
cheetah.obj triSubdiv 3
loop_1
tetrahedron.obj triSubdiv 1
loop_4
tetrahedron.obj triSubdiv 3
loop_5
cheetah.obj triSubdiv 1
loop_6
cheetah.obj triSubdiv 3

Quad Topology

 quadSubdiv( mesh, levels )
Splits each face into quads. This effect is applied levels number of times.
quad_subdivide_1.png
cube.obj quadSubdiv 1
quad_subdivide_2.png
cube.obj quadSubdiv 2
quad_subdivide_3.png
cube.obj quadSubdiv 3
quad_subdivide_4.png
cube.obj (selected) quadSubdiv 1
quad_subdivide_5.png
cube.obj (selected) quadSubdiv 2
quad_subdivide_6.png
cube.obj (selected) quadSubdiv 3

Catmull-Clark Subdivision

 catmullClark( mesh, levels )
Splits each face into quads. This effect is applied levels number of times. Users update the rules as described in the slides. The order in which you should apply the geometrical changes is: modify the positions of the new edge midpoints, modify the positions of the newly created face centroids, modify the positions of the old vertices.
Tip: When calculating the locations for the edge midpoints, take the average of the vertices' positions of that edge, and the average of centroids of adjacent faces.
cc_1.png
cube.obj catmullClark 1
cc_3.png
cube.obj catmullClark 2
cc_5.png
cube.obj catmullClark 3
cc_7.png
dodacahedron.obj catmullClark 1
cc_9.png
dodacahedron.objquadSubdiv 2
cc_11.png
dodacahedron.obj catmullClark 3
cc_2.png
cube.obj catmullClark 1
cc_4.png
cube.obj catmullClark 2
cc_6.png
cube.obj catmullClark 3
cc_8.png
dodacahedron.obj catmullClark 1
cc_10.png
dodacahedron.obj catmullClark 2
cc_12.png
dodacahedron.obj catmullClark 3