Mini-project 1: Mesh Hello World
Due: Tues, Feb 11 (11:59 PM)
This project should be easy. The goal is to implement a simple mesh warping function
Twist() which twists the vertices of a mesh (or
feel free to experiment with other mesh warpings of your choice).
This will make sure everyone can build, load, save meshes, and perform some simple operations on mesh vertices.
The C++ starter code can be used if you desire (you can also use your own code but I may not be as helpful if
you get stuck).
Open the solution or run
make to build
mesh_view. Now running
.off mesh will view it. I have included one mesh in the
meshes subdirectory but more are available in a zip file. You can also download meshes from elsewhere and convert them to
.off using programs such as
trimesh2 or meshlab.
Your goal is to implement a simple warping operation in the method
R3Mesh::Twist(double theta), in
src/R3Mesh.cpp. One possible way to do this is:
After doing this you should be able to 'twist' any input mesh with the command
- Use the instance variable
bbox to retrieve the mesh bounding box.
- Compute zf, a z coordinate normalized to be in [0, 1], based on the z extent of the bounding box.
- Rotate x, y around the center of the x, y bounding box by an angle zf·θ
meshpro input.off output.off -twist theta.
Feel free to collaborate on solving the problem but write your code individually.
Submit your assignment in a zip file named
yourname_project1.zip. Include your code and a screenshot of a warped mesh.
Submit your zip to UVA Collab.