07-06-2009 01:19 PM
I have been having some issues with when a picture control embedded window updates in LabVIEW 8.5. My code basically takes a 3D STL model and rotates it. However, on each update the model must be rotated back to its initial position, followed by a relative rotation to the desired attitude. In the code below you can see the initial rotation followed by the math and picture control call to do the relative rotation. (Ignore the Diagram Disable structure- I used that to remove some code I no longer needed).
The problem is that the display will sometimes update between the initial and relative rotations, rather than after the relative rotation as I have it wired. Even stranger, I have a 1000ms loop time and this "extra" update seems to happen in between loop iterations. It is as if LabVIEW is deciding when to update the display on its own and disregarding my code.
Any ideas about this out there? I do remember reading somewhere that the 3D picture control had some "extra" optimization regarding display updates and when they happen, but I can't imagine that it would disobey normal dataflow rules.
07-06-2009 02:58 PM
Hi Garvacious,
the 3D picture control is not a usual indicator where you write data to. It just exists as reference, so all functions you call for modifying probably update the 3d picture on their own (apart from any LV-internal optimizations)...
07-06-2009 11:45 PM
07-07-2009 12:34 AM
There is a Redraw method of the 3d picture control which you can call to explicitly request a redraw. Also, the picture is redrawn whenever you write to the terminal or a local variable of the 3d picture control. I wouldn't expect it to be redrawn otherwise. But perhaps if your calculation of the second rotation is relatively slow, it might?
But I am not sure if you can prevent updates. I can only suggest that you try to do the rotation in one step (by "Set Rotation" instead of "Rotate Object"). These pages may help you:
Convert From Axis-Angle <-> Quaternions: http://www.euclideanspace.com/maths/geometry/rotations/conversions/index.htm
Add 2 Quaternions: http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/arithmetic/index.htm