Project 2: Modeler
| Assigned | Jan 26, 2023 |
| Due | Feb 9, 2023 |
| Artifact Due | TBD |
| Help Sessions |
TBD TBD |
| Project TA | Ethan Vrhel |
| Artifact Turn-in | |
| Artifact Winners |
| Assigned | Jan 26, 2023 |
| Due | Feb 9, 2023 |
| Artifact Due | TBD |
| Help Sessions |
TBD TBD |
| Project TA | Ethan Vrhel |
| Artifact Turn-in | |
| Artifact Winners |
3D modeling is a key part of the computer graphics and animation pipeline. This is typically performed using industrial-strength tools like Maya, 3DS Max, and Blender. These models can be imported to a 3D engine like Unity to create interactions and behaviors that suit your application needs. There are three parts to this project. First, you will use the surface of revolution technique to construct a mesh with radial symmetry. Second, you will compose several geometric primitives using proper hierarchy and transformations to achieve a humanoid model which you will then create several animation loops for it.
You will need to install Unity to work on this project. For instructions on how to install
Unity and Unity Hub, see the help page.
To open the project, first clone the skeleton code, open Unity Hub, click the Open button and
navigate to your cloned repository. Open the folder that contains the README.md file inside it. It may
take a while the first time opening to import all the necessary packages.
A brief tutorial of Unity is avaliable on the help page.
Implement the surface of revolution in ComputeMeshData() in SurfaceOfRevolution.cs.
You will compute the position, normal, and texture coordinate for each vertex.
The mesh must have correct connectivity (correct vertex orientation and no unnecessary vertices), and you must comply with the number of radial subdivisions.
Implement the surface of revolution in ComputeMeshData() in SurfaceOfRevolution.cs.
You will compute the position, normal, and texture coordinate for each vertex.
The mesh must have correct connectivity (correct vertex orientation and no unnecessary vertices),
and you must comply with the number of radial subdivisions.
You will create a humanoid-like model using simple meshes (like cube, sphere, cylinder, etc.) and at least one surface revolution component you made in the previous part. You will need to create an appropriate hierarchy for your component that would allow for reasonable manipulation and transformation of the parts. Lastly, implement at least two basic animations.
A surface of revolution is a surface created by rotating a curve around an axis. The interface for editing the curve is already provided. Your task is to implement the surface of revolution algorithm given the samples of points on the curve and the number of radial subdivisions. Typically, to describe a mesh you only need vertex positions and a triangle list of how the vertices are connected. In this project however, you are also required to compute the vertex normal and the texture coordinate (UV coordinates) for each vertex.
Go to the SurfaceOfRevolution scene and hit play. In “Play” mode, you will see a working curve editor on your left and some options on the top-right. You should change the resolution to Full HD or any with 16:9 aspect ratio for the UI to display correctly. Right now, you can only create and delete control points of the curve. Once your code is done, you will be able to click ‘Create’ and the output mesh will appear on the lower-right of the screen.
To construct a curve, click anywhere on the graph. The control point will appear on the screen. This graph is on the xy-plane, and the curve you created will be automatically reflected with respect to the y-axis for visualization purposes.
There are several options for the curve and the output mesh:
After changing these options, you will need to click Create again for the change to reflect on your output mesh. We suggest you use the default settings while you are trying to debug your code.
We provide four viewing options of the output mesh (top-right dropdown) to aid your debugging: standard, wireframe, normal visualization, and textured. You can use the wireframe to see the actual triangle of your mesh. The normal visualization shows different colors based on the direction of the normal at that point. This mode is helpful to determine if you get the vertex normals correct. The textured shows your mesh with the textured material. This will help determine if you get your UV coordinates right.
Once you have created a surface, you can click Save to save the control points to a text file, and you can use Load to
load that text file back to get the exact same control points. You can also Export the model as a .asset file so that it can be
used in the next part of the project or one of your own.
To complete this part, fill out the ComputeMeshData() function in the SurfaceOfRevolution.cs.
Your function will use the following variables as inputs:
curvePoints: the list of sampled points on the curvesubdivisions: the number of radial subdivisionsYour function will compute the following, which will be used to generate and visualize the output mesh:
vertices: a list of Vector3 containing the vertex positions.normals: a list of Vector3 containing the vertex normals. The normal should be pointing out of the mesh.UVs: a list of Vector2 containing the texture coordinates of each vertextriangles: an integer array containing vertex indices (of the vertices list). The first three elements describe the first triangle,
the fourth to sixth elements describe the second triangle, and so on. The vertex must be oriented counterclockwise when viewed from the outside.Note that since vertices, normals, UVs are per-vertex information, they will have the same size: the number of vertices.
Texture mapping allows you to “wrap” an image around your model by mapping points on the texture to the vertices of your model. For each vertex, you indicate the coordinate in the texture space that the vertex should be mapped to as a 2D pair (U, V) where U and V range from 0 to 1. For example, if the UV coordinates of vertex 8 is (0.5, 0.5), The very center pixel of the texture will be mapped to vertex 8. Unity and the shader will automatically interpolate the UV coordinate inside the faces based on the UV coordinate of the vertices. You may create a copy of the first set of vertices to allow the UVs to map to the entire texture.
We recommend you first start working on computing the vertices and triangles. Then, move on to normals, and lastly the UVs.
If you want to use a different texture, you will need to do the following:
Assets folders under the Project tab.Assets/Resources/TexturedMat material, then navigate to the Inspector pane to set its Albedo property under Main Maps to be the image file.To verify the correctness of your implementation, follow these steps:
ControlPoints folder and choose our provided file sample1.txt, sample2.txt, etc.In this part, you will create a basic humanoid model and add simple animations. The provided HierarchicalModel
scene, which is basically empty, is the place for you to compose the model.
Regarding your hierarchical model, there are 2 requirements:
The model must be a humanoid whose hierarchy tree has a minimum depth of 3. Your model is created by a hierarchy of nodes, including empty nodes and
Shape nodes (Cube, Sphere, Cylinder, etc). Below is a basic humanoid model which is created with Cube GameObjects.
Here’s an example of a tree with the minimum depth of 3. Your hierarchical model, which consists of Empty Nodes and Shape (Cube, Sphere, Cylinder, etc.) nodes, should be at least as deep as this.
Assets/ExportedMesh folder. Then, in the HierarchicalModel scene,
right-click anywhere in the Assets tab and choose Import new asset and select the file that you just saved. The surface is
imported, which can be dragged into your Scene or converted into a Prefab. As an example, your model’s arms or other body
parts could be made of this surface.
We recommend you refer to class lectures and write down the tree diagram of your model to help you figure out what your model will be, and to practice thinking about empty nodes, centers of rotation, and so on. You do not need to turn in your diagram.
In addition to providing a little fun, the animations will help you learn more about hierarchy design – you will find that certain animations are easier if you plan your hierarchy together with the animations you want to perform.
You are to create 3 buttons that execute basic animations for your model as follows:

You will need to create a new script and attach it to your model to manage animations and handle when the user
presses a button. Create a Canvas GameObject to create a UI (UI -> Canvas). Add buttons by
creating a Button GameObject (UI -> Button -> Text Mesh Pro). Make sure your
buttons are child GameObjects of your Canvas.
Rotations are stored as a Quaternion. To convert between euler angles and
quaternions, use the
Quaternion.Euler() method to create quaternions, and the eulerAngles property of a
Quaternion instance to retrieve the euler angles of a quaternion. If you want to interpolate between
quaternions, use Quaternion.Slerp(), which perfoms spherical linear interpolation.
You may also use Vector3.Lerp() to linearly interpolate between euler angles and then convert
to a quaternion.
You will want your animations to be the same speed regardless of framerate, so you should make use of
Time.deltaTime (which gives the amount of time that has passed since the previous frame) to
normalize the animation speed. You may also place your animation code in FixedUpdate() which
has a fixed Time.deltaTime.
Please follow the general instructions here.
For the artifact, you will create a Hierarchical Model using modeler. As described in Hierarchical Modelling, this model must have at least 3 levels of depth. Also, please DO NOT download meshes from the internet as part of your model.
Create and turn-in a short video screencapture (.MP4 format no longer than 30 seconds) of you showcasing your hierarchical model. Maybe move the camera around to get some different angles, or move the transform controls to show the hierarchy in action as you move it to a different pose. You can use any video capture software you'd like, although we ask that you please submit a video in mp4 format and a screenshot to go with it. Any video capture software works. One such program is Open Broadcaster. You just need to add a Source (Display or Window Capture), and hit Start Recording after changing some Output settings like where to save it and what format to use.
This content is pending, check back later!