LinesVisual3D Aren't Rendering

Jan 24, 2013 at 3:09 PM

I have a WPF app, with my HelixViewport3D's ModelVisual3D Content property bound to a Model3DGroup-type property.  I create some EllipsoidVisual3D objects, and add them to my model group by

      modelGroup.Children.Add(ev3.Model);

Now I want to create some line segments.  I do this

   LinesVisual3D lv3d = new LinesVisual3D();

   Point3D p1 = new Point3D(...);

   lv3d.Points.Add(p1);

   Point3D p2 = new Point3D(...);

   lv3d.Points.Add(p2);

   lv3d.Thickness = 20;

   modelGroup.Children.Add(lv3d.Content);

But my lines aren't visible.  Setting IsRendering to true doesn't help.

I'm doing MVVM, so I don't want to directly add a visual to my viewport, as is done in the Points and Lines sample.  I know I'm using it wrong, I just can't figure out where.  Any help will be appreciated.

Thanks.

-reilly.

Jan 24, 2013 at 4:01 PM

Never mind.  I found and used MeshBuilder.  Works like a champ.

Seriously, objo, you should put a PayPal "Donate" button up here.  I don't know how much they skim off the top, but I would pay you for your work.

Coordinator
Feb 4, 2013 at 3:26 PM
Ok. I will check if there is a bug in the LinesVisual3D change notifications, though.

I added an Amazon wish list link at the home page, if you feel for donating a book! :)
Feb 4, 2013 at 4:25 PM
I had to do it: "Practical Rendering and Computation with Direct3D 11" is on the way.

[FYI, I'm working on a tool to extract statistics from 50 micron scans of coupons which have been subjected to corrosive environments. We read the scan data and visualize it in 3D. The tool provides controls to process the image, detect corroded pits, and extract their statistics for use in modeling. I used Helix to show and annotate the data. It couldn't have been easier.]

Please keep up the good work.

Regards,

-reilly.
Coordinator
Feb 5, 2013 at 8:55 AM
Great! Thank you!
Regarding the code - it seems like you are 'stealing' the Model3D from the LinesVisual3D instance. The screen space visuals must be updated every time the camera or transforms are changed, currently this is handled by the CompositionTarget.Rendering event. I guess there was no updating going on in your case where you had disconnected the LinesVisual3D from the visual tree.