Alright then. Let's take a look at what ingredients I'll need in order to make the Viewer:
Face class:Like a good mad scientist, I even sketched out how I want my monster to look:
- has a collection of vertices
- has a normal
- has a color
- has a Draw() function
ObjParser class:
- has a collection of vertices
- has a collection of Faces
- has a Clear() function for resetting the contents of its collections
Mesh class:
- has a collection of vertices
- has a collection of Faces
- has a "Visible" boolean
- has a Draw() function (calls each Face's Draw())
Head class:
- extends Mesh
- (has animations)Collider class:- extends Mesh- has a PointInCollider() boolean function (that returns the shortest projection out of the collider)
HeadCollider class:
- extendsColliderMesh
- has a dictionary that maps its vertices to vertices in a Head
- has a PointInCollider() boolean function (that returns the shortest projection out of the collider)
Scalp class:
- extends HeadCollider
HairGroup class:
- has Strands, Clusters, and Strips
- has an Update() function
- has a Draw() function
- project focus
HairManagerEngine (HairRenderer) class:
- has a Scalp
- has a HairGroup
- has a GrowHair() (set_geometry()) function
- has an init() function (for GPU work)
- has an Update() (update_geometry()) function (calls its HairGroup's Update())
- has a Draw() function (calls its HairGroup's Draw())
- project focus
Camera class:
- has a position
- has an up vector
- has a focus point
- has rotate functions
- has zoom functionsTreeNode class:
- has a parent TreeNode
- has a collection of children TreeNodesGeometryNode:
- extends TreeNode
- has a Mesh
- has a Draw() function (calls its Mesh's Draw())TransformNode:
- extends TreeNode
- has a transformation matrix
- has functions for editing its transformation matrixSceneTree class:
- has a collection of GeometryNodes
- has a collection of TransformNodes
- has TreeNode insertion and deletion functions
Window class:
- has a HairManagerEngine (gets it from Viewer)- has a SceneTree (gets it from Viewer)
- has a collection of Meshes (gets it from Viewer)
- has a Draw() function (calls eachGeometryNode'sMesh's Draw() and its HairManagerEngine's Draw())
- has callback functions
Viewer class:
- has a light (a vector position)
- has an ObjParser
- has a Scalp
- has a Head (should match up with its scalp)
- has a collection of Colliders
- has a HairManagerEngine
- has a Camera- has a SceneTree
- has a Window
- has callback functions
Viewer class capabilities:
- import an .obj (or .mesh?) scalp into the scene (just one)- import an .obj (or .mesh?) head into the scene (just one)
- a corresponding Scalp object should be created
and inserted into the SceneTree- ConvertObjToScalp() function to do this
- uses Decimate() function
- import an .obj Collider into the scene (as many as desired)
- a corresponding Head object should be created
and inserted into the SceneTree- ConvertObjToHead() function to do this
- a Collision object should be generated from the Head's geometry
- ConvertHeadToCollider() function to do this
- uses Decimate() function
- remove Scalp, Head, or Colliders from the scene
- a corresponding Collider object should be created
and inserted into the SceneTree- ConvertObjToCollider() function to do this
(delete them from the SceneTree)- move around the scene with a Camera
- Node deletion functions to do this
- light the scene with a point light that can be rotated around the center of the scene
- Camera rotate and zoom functions to do this
- rotate the Head around- (trigger Head animations)
TransformNodetransform matrix manipulation functions to do this
- move and rotate Colliders (not the head collider, though) around- add a HairGroup to the Scalp
- Transform matrix manipulation functions to do this
- GrowHair() function to do this
Viewer class Q&A:
Q: For high-poly objects, is there a more efficient way to render them than by looping through each face and telling OpenGL to draw it?
A: For now, no.
Q: If the .obj head is going to be animated in some way, then perhaps importing the .obj should be eliminated in favor of importing some kind of .mesh object with associated keyframe data. This involves collaboration with Cat to see how this .mesh object might need to be drawn.
A: Since I have not heard back from Cat about this, I'm going to import an .obj head and give the user controls for rotating it. This should be good enough for approximating "yes" and "no" head animations.
Q: Should colliders be spheres, cubes, or meshes? Should collisions be determined by space partition instead?
A: For now, the plan is to make the head collider a decimated version of the original head.
No comments:
Post a Comment