Gents,
Having now spent a fair bit of time with Famous vs rolling my own 3d, I’m finding Famous a bit slow to dev with and I think the source of the problem is the coordinate system.
Q) Are you considering representing the position of a node using a similar system as famous (position/rotation/scale/etc), or have you considered representing it as a 4x4 transformation matrix instead?
While the famous way of doing things is “easier” for the untrained, Matrices are how one is taught these things in school and is how the various literature and text books present the concept of scene graph.
The reason I raise it is because of the following:
-
I have found the Famous coordinate system is a constant source of frustration when one is comfortable using matrices. Specifically, the Famous coordinate system actually slows down development and makes code more brittle. This is because
-
there is an implicit order in which the various transformations have been composed that sometimes isn’t appropriate to the task at hand (for example, I may want to rotate then scale; other times I may want to scale then rotate)
-
there are implicit transformations being applied to nodes when one doesn’t expect it (For example, sometimes I want to translate-scale-detranslate-rotate-translate-scale a node, that is impossibly difficult in famous because of the implicit origin/align/etc side effects that come with its graph), and
-
there exists useful transformations that are impossible with the Famous coordinate system (skew is the simplest example).
-
I think you will find it will make the internal API alot simpler. Having spent a bit of time in the Famous internals, some of the least pleasant code within Famous has a lot to do with wrangling the Famous coordinate system.
There is a certain elegance and simplicity with matrix representation of transforms that has been lost with the Famous API and I think its worth reconsidering.
To make this more concrete, what would be convenient is a Node#setMatrix() / Node#getMatrix()
You could still implement that simpler interface for the less lin-alg inclined, but it would be most useful to be able to work with matrixens if one so desires. It is easy to implement get position/scale and for the sake of simplicity, if one has done a setMatrix() then it would be reasonable for the node to throw an exception if one then does something like a getRotation().
Just a thought. Possibly a good one.
ap.