Mini-Maya Editor
Project Details
A Mesh Editor application in the style of Autodesk Maya or Blender. Implementing with C++ and OpenGL in QT. Supported features include vertex/edge/face editing, edge division, face triangulation, Catmull-Clack subdivision for smoothing, skeleton binding, and skinning.
Subdivision
Edge division & Face triangulation
skeleton binding & Skinning
I first implement an interactive skeleton by adding a QTreeWidget to the GUI from which the user can select a joint in the scene's skeleton. The user would be able to alter the position and rotation of the selected joint through additional widgets in the GUI. When a joint is selected, it could change color in the GL view. When the user transforms a joint, it would visually rotate and translate in the GL viewport. The selected joint's current transformation would also be displayed numerically in the GUI for easy tracking.
Then I write a new shader composed of two files: skeleton.vert.glsl and skeleton.frag.glsl. These shaders would transform vertices based on the joints that influence them. I only implement linear blend skinning here. Some of the variables included in my shader are listed below:
- Bind Matrices: A uniform array of matrices that each describe the bind matrix of a particular joint. Since GLSL arrays must be assigned a size at compile time, I hard-code this to be an array of 100 mat4s here.
- Joint Transformations: A uniform array of matrices that each describe the current overall transformation of a particular joint.
- Vertex's influencer IDs: An in variable that contains the IDs of the joints that influence the given vertex which correspond to the index at which its bind and transformation matrices are stored in your arrays.
- Vertex's weights: An in variable that describes the weights of the joints that influence the given vertex. Each element in this set of weights align with the element in the ID set that corresponds to the joint this weight describes. For example, if a vertex had joint IDs [0, 4] and weights [0.45, 0.55], then joint 0 would have a weight of 0.45 and joint 4 would have a weight of 0.55 on this vertex.