Jump to content

3D surface blinking problem


maybe

Recommended Posts

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.

Link to comment

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.

Link to comment

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.

Link to comment

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.

Link to comment

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.

Link to comment

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.

Link to comment

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

Link to comment

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.