So, working on the renderer/camera classes, I've finished up the matrix integration as far as the view and projection matrices go (more or less). So now the cube looks like a cube and the pyramid looks like a pyramid. So that's all good.
I started thinking about the next matrix, which is the world matrix. This one is both the most straightfoward and the most complex, at the same time
The equations for putting this matrix together are pretty easy, it's just a combination of translation, rotation, and scaling values. But where this gets complex is where those values come from.
I think I want to do something that is kind of Maya-ish. I want to use nodes.
So when you say "Create a cube" (or any other shape), the program will actually create three nodes for you. A transform node, a shape node, and a construction node.
The transform node will be responsible for the location, rotation, and scale of the geometry. Essentially, it is the pivot point, or the (0,0,0) of the model, from which all the vertices are relative to. It will hold location (x,y,z), rotation (x,y,z), and scale (x,y,z) values, as well as a visible boolean. All of these values would be modifiable at any time in the channel box (which is simply a box that shows all the nodes of whatever you have selected along with their changeable characteristics). Transform nodes have no shape of their own, they simply define a point in space.
The shape node is the actual geometry shape. Basically it will simply be a default set of vertices and indices. It won't have any changeable characteristics. When you move/rotate/scale the transform node, the shape geometry is what will adjust (as it is basically a child of the transform node).
The last node is a construction node. This won't change the shape of the node (except perhaps with curved geometry, like a sphere). It will control the granularity of the vertices in the shape. For example, you might want each horizontal face of a cube to be comprised of two faces rather than one. Or you might want 20 vertices to define the equator of a sphere rather than 10 (to make it rounder). That would be the construction node's realm. Of course, these would also be changeable through the channel box.
Does all that make sense?
"They laughed when I said I was going to be a comedian ... They're not laughing now." - Bob Monkhouse