LinesVisual3D Aren't Rendering
jrhokie1 wrote at 2013-01-24 15:09:
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
Now I want to create some line segments. I do this
LinesVisual3D lv3d = new LinesVisual3D();
Point3D p1 = new Point3D(...);
Point3D p2 = new Point3D(...);
lv3d.Thickness = 20;
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.
jrhokie1 wrote at 2013-01-24 16:01:
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.
objo wrote at 2013-02-04 15:26:
I added an Amazon wish list link at the home page, if you feel for donating a book! :)
jrhokie1 wrote at 2013-02-04 16:25:
[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.
objo wrote at 2013-02-05 08:55:
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.
Customer support service by UserEcho