LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is possible customize the Gauge Indicator?


@ToeCutter wrote:

If you want a custom needle, this is ideal fodder for a 3D picture display. If you display it as a couple of textured quads in 3D (or a quad for the face and a piece of custom geometry for the needle) you effectively get 'real time' rotation for free with negligible CPU overhead.

 

I have some code to do '2D in 3D' (attached). It needs cleaning up but it gives you the basics. It's based on LV's 'solar system' example.



This is pretty brilliant. It's crazy that functionality for a gauge needle needs to be done this way. My only question is if you might know what I'm missing that's causing all of my PNG files with transparent backgrounds to come in with a black background? I've attached the needle I'm trying to use and a picture showing the ways I've tried to set the background color.

 

Download All
0 Kudos
Message 11 of 15
(1,426 Views)

Cheers Johhny- glad someone appreciates the advantages of hardware acceleration!

 

To answer your question- not sure.

 

I think it's probably a case of a few settings. Check out the sceneobject.blending settings and also take a look at the following thread and you may come up with the answer. Be sure to check the alpha channel on your pngs once more to ensure you're not barking up the wrong tree.

 

http://forums.ni.com/t5/LabVIEW/half-transperent-mesh/m-p/783805/highlight/true#M358263

 

If you crack the problem, could you please post the answer back here? Thanks

0 Kudos
Message 12 of 15
(1,390 Views)

It was user error causing the black backgrounds-I'd somehow saved the PNGs as non-interlaced.

 

I didn't have any luck getting a transparent background but settled for removing the control's border and matching the BG color to the front panel color. One thing I'm struggling with still is being able to update multiple images' angles. I've tried various combinations of for loops and while loops based on this example and this one but either get constant flickering or alternating between images displayed. I've attached a simplified/slightly cleaned-up version of your 2D in #d example, including images and control. If anyone could tell me what I'm doing wrong, I'd greatly appreciate it.

0 Kudos
Message 13 of 15
(1,341 Views)

Hi johhny- try following what I did a bit more closely. You don't want to be loading graphics and recreating the scene from scratch every loop- load and setup once, then just modify a few translations/rotations every loop as I did.

0 Kudos
Message 14 of 15
(1,328 Views)

Thanks for the super-quick reply. I've changed back to something I tried earlier but can't quite get it right. I can get the 3 images to display on individual displays but if on the same one I only get 1. I've tried various combos in the for loop with indexing the scene, using a shift register with one scene reference, with the same on the object reference. I'm sure I'm missing something really obvious here and honestly not trying to get you to do this for me, I just can't seem to figure out where I'm going wrong.

 

0 Kudos
Message 15 of 15
(1,307 Views)