09-12-2009 11:30 PM
I'm trying to program a simple 3D simulation in LabVIEW and am running into numerous issues with the 3D graphs.
1) An old program I had used the 3D ActiveX graph. When I load that VI, LV says it could not load the ActiveX control. I never intentionally uninstalled it. From the help I've found, it sounds like 8.6 should support the 3D ActiveX graph and the new Native (XControl) graph. Any ideas how it might have come unstuck on my computer, or how to retrieve it? It is also gone within LV 8.5 now too.
2) I can find very little help about the new Native 3D Graph. I found one example, which was amazingly incomplete. No instructions on the front panel. 3 graphs were generated on the diagram, but only one was connected to the indicator. Very odd.
3) I first placed the graph on a tab control and had very odd display issues. Someone had mentioned this type of problem recently (though I think they were referring to the ActiveX 3D Graph), so I moved it off the tab. However, it still has odd display issues. For example, often when the VI is not running, the graph control displays odd snippets of the Windows desktop - things that had been displayed on those pixels of the screen at some previous time. When the program is running, the graph flashes between what it should display and these bogus images.
4) I am using the create_plot_line VI to try to create two lines on my graph. As a sort of animation, I calculate increasing arrays of points and continuosly update the graph with more and more points, so the line (trajectory) grows. It seems like this is more like a "graph" than a "chart", so I should always create the plot with all the points that should be plotted, not just plot the one new point like you would with an old LabVIEW chart. And that sort of works. But if I leave the program running and restart the trajectory after it has already plotted it once, then a line appears from the end of the trajectory back to the beginning, as if it still has all the old points in some sort of memory and is adding new points, hence drawing a line from the last point from the first program iteration to the first point on the second iteration. So I'm a bit confused about how this type of graph is supposed to be used. Why are there no examples or instructions? (Or am I just missing them - e.g. not seeing them, or maybe they got erased from my system like the ActiveX graph did...)
Under the assumption that this graph is more like a picture control, where you add an element with one VI and pass the ref to another VI that adds another element, etc., I have tried wrapping the graph's main wire around in a shift register and only plotting the one new point. It doesn't really seem to work... The trajectory is there, but only when you rotate the 3D view.
5) I want the two trajectories to be different colors. Luckily there is a "color vector" input to the sub-vi that will probably do this. But I can find no documentation on it. You can't read this color vector with a property node, that I can find, so I can't get an example of the current color vector. I can see this color vector in the 3D Graph Properties page, but at that point, you can only change the colors of the over and under points, not the main color ramp. I tried specifying an array of color boxes, but didn't get reasonable results. I probably don't have the right number of elements. Interestingly, the Color Vector input is an array of reals! The context sensitive help for the sub-vi is useless. Isn't this documented somewhere?
Thanks for any help,
DaveT
09-22-2009 07:47 AM
Dave Thomson wrote:..
5) I want the two trajectories to be different colors. Luckily there is a "color vector" input to the sub-vi that will probably do this. But I can find no documentation on it. You can't read this color vector with a property node, that I can find, so I can't get an example of the current color vector. I can see this color vector in the 3D Graph Properties page, but at that point, you can only change the colors of the over and under points, not the main color ramp. I tried specifying an array of color boxes, but didn't get reasonable results. I probably don't have the right number of elements. Interestingly, the Color Vector input is an array of reals! The context sensitive help for the sub-vi is useless. Isn't this documented somewhere?
Thanks for any help,
DaveT
To set the color ramp you need to set the colors and the values and you need the same number of elements in each array. You will also have to set the ramp style you want to custom.
Also note colrs are "BGR" not "RGB".
Ben