07-15-2015 10:55 AM
Hi WCR,
I don't use labview's 3D stuff, so I can't say for sure what it is doing, but I have a theory of what the problem was. I think that those 'Set_X' vi's were setting a (scaling|translation|rotation) matrix that are only evaluated when the vector is drawn. Below is how I think it played out.
This way, the rotation transformation would always happen before the scaling, which gives your undesired behavior. I guess this is what it means in the vi's description where it says that this is an 'absolute rotation'. I hope this makes sense.
07-21-2015 10:43 AM
Thank you Intaris.
07-21-2015 11:13 AM
Akovaski,
Thanks for your analysis. I have been away, hence my delayed resonse. You mention that if one does
1. Set Scaling Matrix S = ( ... )
2. Set Rotation Matrix R = (...)
3. Set Translation Matrix T = (...)
then Labview will do
4. Draw vector: Output = T * S * R * (original_vector)
I would expect step 4 to be
4. Draw vector: Output = T * R * S * (original_vector) (1)
The results suggest that Labview is doing step 4 as you predicted - not as I expected - when I use SetScale, SetRotation, SetTranslation. The LV documentation on these VIs, and simple logic, would not lead me to expect this. When I replace SetRotation with RotateObject, as you proposed, I get the desired and expected behavior (2). As Intaris said: Your idea works, which is the important thing.
(1) I actually did S, then T, then R in my originally posted VI, so I expected R*T*S*vector, and I seem to get T*S*R. But your insight is still valid: that the vectors are getting rotated before being scaled.
(2) In my VI, it is essential to use ClearTransformations if one uses RotateObject, otherwise unwanted behavior occurs. This is as I would expect.