![]() |
|
Wireframe Model - Printable Version +- AB4D Forum (https://forum.ab4d.com) +-- Forum: Products Forums (https://forum.ab4d.com/forumdisplay.php?fid=4) +--- Forum: Ab3d.PowerToys (https://forum.ab4d.com/forumdisplay.php?fid=9) +--- Thread: Wireframe Model (/showthread.php?tid=3935) |
Wireframe Model - ZENUAV - 05-18-2015 I current add my model to the viewport using code. XAML is Code: <!--Landscape Model-->C# Code: // add model to landscape groupWhat is the best setup if I want to show a Wireframe version of the model? I already tried this XAML Code: <visuals:WireframeVisual3D WireframeType="WireframeWithOriginalSolidModel" >C# Code: WireframeModel = mGeometry;But the above did not showing anything. Please help ;) RE: Wireframe Model - abenedik - 05-18-2015 The WireframeVisual3D does not automatically regenerate the wireframe when the model is changed. To regenerate wireframe you need to call the RecreateWireframeModel method. If you set the WireframeModel after the WireframeVisual3D is loaded, then you need to call the RecreateWireframeModel method. RE: Wireframe Model - ZENUAV - 05-18-2015 I must be missing something here. XML Code: <visuals:WireframeVisual3D x:Name="WireframeVisual" WireframeType="WireframeWithOriginalSolidModel" >C# Code: // create 3D model using mesh and materialStill not displaying?? Can you give me XAML/Code example or correct mine please. I'm very new to your API, will purchase, but need to get basics sorted first. Thanks Jason Sorted! Used the following :- Code: // create wire frame model using models meshThanks Jason RE: Wireframe Model - abenedik - 05-19-2015 Now I see where was the problem: You have changed the WireframeModel reference from the object defined in XAML to another object created in code (mGeometry). This did not change the WireframeModel defined in XAML - it still remained empty. To fix your code you have two options: 1) Set OriginalModel property on WireframeVisual3D to your new Model3d: Code: WireframeVisual.OriginalModel = mGeometry;Note that the content of WireframeVisual3D that is defined in XAML is also set to OriginalModel property. 2) Update the WireframeModel and call RecreateWireframeModel method: Code: WireframeModel.Geometry = mGeometry.Geometry;It is also possible to use the Ab3d.Models.WireframeFactory.CreateWireframe method and add that directly to your scene. Though I would recommend using the WireframeVisual3D because it gives you more options on how to show wireframe. RE: Wireframe Model - ZENUAV - 05-20-2015 (05-19-2015, 03:47 PM)abenedik Wrote: Now I see where was the problem: I've used CreateWireframe and added it to scene, but like you say I don't have as much control over options so might change it to WireframeVisual instead. Thanks for help! |