Open markcmiller86 opened 2 years ago
It's been a little while since I took graphics in school, and I don't know a whole lot about our transform operator, but I thought that the order needed to always be scale, rotate, translate. You should be able to get every configuration with that order. I am surprised to hear that we do rotations first; is there a reason for that? I thought scaling needed to come first because scaling is typically done in the x, y, and z directions, and doing a rotation first will change what you are scaling.
So I guess I'm confused. Why do we do rotation first? If we did our operations in the order scale, rotate, translate, then wouldn't that solve your issue, and any further issues with transformations?
So I guess I'm confused. Why do we do rotation first?
If you are speaking within the context of a graphics library and the operations required to set a view, then yes, I think you are correct about the ordering needed for that specific case.
VisIt's Transform operator is less about setting a view and more about setting one object (variable) relative either to the current view (coordinates) or to other objects. In that case, the specific operations and their orderings are completely arbitrary. For example to rotate one object in a scene 90 degrees but have it otherwise remain in the same position relative to other objects in the scene, the transformation applied to it would be the catenation of a translation to origin, rotation and translation back to its original position (all in one matrix).
If you are speaking within the context of a graphics library and the operations required to set a view
I wasn't talking about setting a view, but about setting the positions, sizes, and orientations of geometry in your scene. Is that the same thing?
In that case, the specific operations and their orderings are completely arbitrary.
How are they arbitrary? I don't understand. Following your example, let's say S = scaling matrix R = rotation matrix T0 = translation to origin matrix T = translation to object position matrix M = final model transformation matrix
In your example, M = T R T0 Since the model is translated to the origin, rotated 90 degrees, and translated back.
If I've understood what you've told me, you and the docs are saying that in general, M = T S R * T0
If that is the case, then what I'm trying to propose is that we switch the ordering, so that M = T R S * T0
This way, you don't need to run two distinct transformation operations to accomplish what you were trying to do in your original post, as rotation is "applied" after scaling. It also means we don't need to add functionality for users to choose what order their transformations are applied. I can't imagine too many situations where users would want to scale after rotating.
Am I understanding this correctly? Hopefully all will be cleared up in our meeting tomorrow.
Some thoughts/action items.
Is your feature request related to a problem?
We have a Transform operator that supports rotation, scaling and translation. However, docs indicate the order is pre-defined as rotate, scale, translate.
I wanted to scale and then rotate
globe.silo
. I needed to add two transform operators to make that happen. Trying to use one operator had no effect (as you can imagine because rotating spherically symmetric data is indistinguishable :wink:)Is there a way we could add the ability to specify order in the Transform operator. Two ideas...
0
...3
where0
means disabled and1
,2
or3
indicates order of the operation.