Jump to content
Jason H

3D picture control color map

Recommended Posts

I've been working with the CWGraph3D library for plotting 3D antenna patterns. Overall it works quite well. However, there are a few limitations that I'm not sure can be worked around.

The problem is that the rotation is not truly 3D. There are only 2 axes of rotation, not 3. You can see the pattern at every (theta, phi) point, but at any given point, you cannot rotate about that point except for at the poles. For example, you can rotate about the z axis (the poles) but you cannot rotate about the x or y axes. Its difficult to think about unless you have a model in front of you.

Another issue is performance. The CWGraph3D performance seems a little sketchy at times, and I don't have low-level control. For example, when plotting a new set of data, the whole control frame goes blank briefly before showing the new plot. With a 3D picture control however, I could just update a single object in the scene.

Finally, I would like to import an STL file and overlay it with my antenna pattern to easily visualize what is going on. However, I don't think the CWGraph3D mesh can plot triangles. Perhaps it can but I don't understand how to use it properly.

The only problem with using a 3D picture control however is the color map. If I could figure that out then I would have no reason to use the CWGraph3D control other than all the work involved in building up what I need from low-level components.

I've attached a picture from my program. Note that the top right corner is an overlaid 3D picture control showing an STL file, and the main plot is a CWGraph3D picture. I want to create something identical but with a 3D picture control. How would I create a color map and grid lines?

Share this post


Link to post
Share on other sites

There are generally two ways to achieve color map with 3D Picture control: "per vertex" coloring scheme or texture. First one is probably simpler and provides potentially nicer, scale independent result. With second one you may get more sophisticated result (i.e. cobining map with an image), but you have to earlier map 3D surface to 2D image and provide texture coordinates for each vertex.

What concerns displaying grid I did't find efficient way to do this. You can set either polygon or wireframe draw style and I found no way to get shaded object with wireframe. I tried two create two identical objects - one shaded and second "wireframed" but effect was little bit strange - kind of blinking during rotation. Maybe the method would be to move wireframe vertices a little in normal direction, but still it is not a way how it should be done.

Another problem with 3D control is speed (at least when you don't use a separate window).

Although 3D Picture Control is very simple to use, for a longer term I find it not flexible enough, and therefore already for a long time I experiment with various external 3D engines. Recently I found .NET bindings for VTK (which is widely known scientific visualisation engine) and first results are very promising.

Share this post


Link to post
Share on other sites

Hi Vugie,

 

I am also exploring various 3D engines for use in aircraft simulators.  I thought at first to use the native 2D picture control with your BITMAN library (very nice!) but found that I would need native support for transparency and anti-aliasing.  Do you have any examples of using LabVIEW with VTK?

 

Thanks

Share this post


Link to post
Share on other sites

I haven't invested too much time in that. All I got was 3ds model loaded into separate window and mouse controller. It was old .NET wrapper to VTK (http://vtkdotnet.sourceforge.net/ as I remember).

Some time ago KitWare relased their wrappers called ActiViz as open source (http://www.vtk.org/Wiki/VTK/CSharp/ActiViz.NET). I also tried it but I got only a buch .Net exceptions (also during wiring).

In both cases it was a painful process of converting simple C# examples to LV (long, long, looooong horizontal diagrams)

 

 

test vtk activiz.vi

test vtk.vi

Share this post


Link to post
Share on other sites

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.