Create more generalized transforms.
Mokosha opened this issue · 0 comments
Currently, the Transform
type exposed to the user is what I'll call a TRS
transform. In other words, it's only a scale, rotation, and translation, in that order. This means it's not really possible to, e.g., rotate an object about a point. All rotations are done relative to the origin in that object's object space.
Internally, the rendering engine only really cares about Mat4f
s, so however those get generated doesn't really matter. This means that we can have lower-level transforms that can stack translations, rotations, and scales one on top of the other, similar to how the old glPushMatrix
calls worked. These would then flatten to the appropriate matrix at rendering time.
The changes that are needed (off the top of my head) are:
- Create new
TRS
datatype that replaces the currentTransform
datatype - Create new
Transform
datatype that acts as a stack of simple transforms - Instance
Transformable3D
for newTransform
datatype - Change
RenderContext
to useMat4f
instead ofTransform
inRender.hs
. - Change type of
addTransformedRenderAction
to parameterize overTransformable3D
to use both types of transforms.