maybe Posted October 18, 2008 Report Share Posted October 18, 2008 Hello, When I am working with the CWgraph3D control, I met another problem. Say, I am plotting a surface with given x, y and z vectors. The vectors are changing every time in a loop. I have the plot showed right but it is just blinking (due to the fact that I "remove all" plots every time before I plot new things in the 3D control). I wonder how can I solve this problem to have a smooth display? FYI, I am giving the x, y and z vectors from 3 points (P1, P2, P3) in real time moving; So I want to keep trace of motion of the surface which created by the 3 points. Thank you for you help. Regards. Quote Link to comment
maybe Posted October 21, 2008 Author Report Share Posted October 21, 2008 QUOTE (maybe @ Oct 17 2008, 12:13 AM) Hello,When I am working with the CWgraph3D control, I met another problem. Say, I am plotting a surface with given x, y and z vectors. The vectors are changing every time in a loop. I have the plot showed right but it is just blinking (due to the fact that I "remove all" plots every time before I plot new things in the 3D control). I wonder how can I solve this problem to have a smooth display? FYI, I am giving the x, y and z vectors from 3 points (P1, P2, P3) in real time moving; So I want to keep trace of motion of the surface which created by the 3 points. Thank you for you help. Regards. I have attached an example here, hope some one can give me some suggestion. P.S. my application is real time purpose, so I cannot do everything behind scene and demostrate them afterwards. Quote Link to comment
Francois Normandin Posted October 22, 2008 Report Share Posted October 22, 2008 I don't think I understand what your trying to achieve. Is there a reason why you clear the graph every loop? If you don't clear it, you'll just overwrite the last vectors and have a smooth update. If there's a reason why you need the Clear Data, please explain. Quote Link to comment
maybe Posted October 22, 2008 Author Report Share Posted October 22, 2008 QUOTE (normandinf @ Oct 20 2008, 11:17 PM) I don't think I understand what your trying to achieve. Is there a reason why you clear the graph every loop?If you don't clear it, you'll just overwrite the last vectors and have a smooth update. If there's a reason why you need the Clear Data, please explain. In my real application, the vectors will change in every loop (some time it stays the same , but most the time it changes), and I believe if I dont use the "remove all"/"clear data" the plots will overlap with previous. Or am I wrong about it? Thanks. Quote Link to comment
Francois Normandin Posted October 22, 2008 Report Share Posted October 22, 2008 QUOTE (maybe @ Oct 21 2008, 04:32 AM) In my real application, the vectors will change in every loop (some time it stays the same , but most the time it changes), and I believe if I dont use the "remove all"/"clear data" the plots will overlap with previous. Or am I wrong about it? Thanks. It will not overlap indeed. To convince yourself, add a random number in every iteration of your VI and you'll see the vectors will be overwritten, not overlapped. If you were in need of overlapping to keep the trace, you'd need to use shift registers and append the new data. I suggest you move the "Clear Data" before the while loop so you effectively clear the graph every time you start your VI. Quote Link to comment
maybe Posted October 22, 2008 Author Report Share Posted October 22, 2008 QUOTE (normandinf @ Oct 21 2008, 12:56 PM) It will not overlap indeed. To convince yourself, add a random number in every iteration of your VI and you'll see the vectors will be overwritten, not overlapped. If you were in need of overlapping to keep the trace, you'd need to use shift registers and append the new data. I suggest you move the "Clear Data" before the while loop so you effectively clear the graph every time you start your VI. Hey, thanks for that piece of information, I assumed that when I update the plot I have to clear the canvo first, and I am wrong. I will try to implement it to my application and see if things work out. Again, thanks. Quote Link to comment
maybe Posted October 22, 2008 Author Report Share Posted October 22, 2008 QUOTE (normandinf @ Oct 21 2008, 12:56 PM) It will not overlap indeed. To convince yourself, add a random number in every iteration of your VI and you'll see the vectors will be overwritten, not overlapped. If you were in need of overlapping to keep the trace, you'd need to use shift registers and append the new data. I suggest you move the "Clear Data" before the while loop so you effectively clear the graph every time you start your VI. Hi, I found the reason why I want the "clear data"/"remove all", In my application I have to plot two surfaces, and I used "CWGraph3D->Plots then CWPlots3D->Add". In this case, I have to remove the data (clear the data) everytime in a loop or else it will keep on adding new plots (overlap). Now I can solve the blinking problem with 1 single plot, but what can I do with more than 1 plot in the 3D control? Any suggestions? Thanks. Quote Link to comment
LAVA 1.0 Content Posted October 22, 2008 Report Share Posted October 22, 2008 QUOTE (maybe @ Oct 21 2008, 04:27 PM) Hi, I found the reason why I want the "clear data"/"remove all", In my application I have to plot two surfaces, and I used "CWGraph3D->Plots then CWPlots3D->Add". In this case, I have to remove the data (clear the data) everytime in a loop or else it will keep on adding new plots (overlap). Now I can solve the blinking problem with 1 single plot, but what can I do with more than 1 plot in the 3D control? Any suggestions? Thanks. Take a look inside the shipping examples for the 3d plot. You will see that it is possible to use a "item" property off of the plots reference to select which plot your data is used for. Note that the CW 3D graph uses "1 based" numbering (first element is "1" not "0"). Ben Quote Link to comment
maybe Posted October 25, 2008 Author Report Share Posted October 25, 2008 QUOTE (neB @ Oct 21 2008, 08:42 PM) Take a look inside the shipping examples for the 3d plot. You will see that it is possible to use a "item" property off of the plots reference to select which plot your data is used for. Note that the CW 3D graph uses "1 based" numbering (first element is "1" not "0").Ben Thank you, I got it. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.