LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

when is a 3D picture control updated?

 

 

 

 

 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.

 

3d pictur control code.JPG



0 Kudos
Message 1 of 4
(2,773 Views)

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)...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,761 Views)
If that's true then you'd think there would be a property that you could use to control when the display is updated.  I would use the "defer front panel updates" property but that affects everything on the panel.


0 Kudos
Message 3 of 4
(2,748 Views)

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

0 Kudos
Message 4 of 4
(2,743 Views)