Jump to content

Hacking 3D Graph Control for Drawing objects like we do in 3D Picture Control


Recommended Posts

I need to draw objects in a 3D Graph Control, just like we do in the 3D Picture Control.

Since the 3D Graph Control is "made from" the 3D Picture Control, I got the 3D Picture Control ref from the convenient property node. Then I created a cube and drew it in this picture control ref. Now the result wasn't what I wanted, but it also didn't surprise me. All the axes and grids were wiped out and all I got was the cube.

Now if I rotate the view and leave the mouse button, the cube is gone and we get the axes and grid planes back. The 3D Graph Control probably has a redraw function that made this happen.

Is there a way to hack the 3D Graph Control so that we can use the surface plots, cursors etc. that it was intended for, but also draw geometries and textures as we can do with the 3D Picture Control?

post-9308-0-32983800-1313168259_thumb.pn

Drawing Object in 3D Graph Control - 2009.vi

Link to comment

The 3D graph, if memory serves, is an unlocked XControl, so you should probably be able to edit it, although I don't know how easy it would be and you would need to create a copy of the entire library so that it's not overwritten when you upgrade LV. Presumably it's somewhere in vi.lib and you should be able to easily see it by right clicking a 3D graph and selecting Advanced>>Show Diagram, which I believe should be available in all XControls.

Link to comment

The 3D graph, if memory serves, is an unlocked XControl, so you should probably be able to edit it, although I don't know how easy it would be and you would need to create a copy of the entire library so that it's not overwritten when you upgrade LV. Presumably it's somewhere in vi.lib and you should be able to easily see it by right clicking a 3D graph and selecting Advanced>>Show Diagram, which I believe should be available in all XControls.

Thanks for the clue!

I've done something similar to the XControl for Spectrogram in the Order Analysis toolkit in the past.

I'll try this one and will post the code if something good comes out of it.

Link to comment

Is there a way to hack the 3D Graph Control so that we can use the surface plots, cursors etc. that it was intended for, but also draw geometries and textures as we can do with the 3D Picture Control?

You should rather do it like this:

post-7450-0-01040000-1313494205_thumb.pn

However I'm not sure whether XControl could do something later with objects you add. That's a question to its developer. You may also get access to individual elements of a graph (also without any warranty). Example how to do it is here.

I personally avoid to use new object style XControls for 3D plots. Loading time is a sufficient reason. Stability is second one.

  • Like 1
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.