MouseWheelMessageFilter
#9
(02-22-2021, 10:25 AM)abenedik Wrote: In the AssimpWpfImporterSample the ContentVisual is defined in XAML:

            <Viewport3D Name="MainViewport">
                <ModelVisual3D x:Name="ContentVisual" />
                <visuals:WireframeVisual3D x:Name="ContentWireframeVisual" ShowPolygonLines="True" WireframeType="Wireframe" UseModelColor="False"
                                           LineColor="Black" LineThickness="1" />                
            </Viewport3D>


I see that you already have a field ContentVisual, but because of the exception, you get it seems that you did not yet create an instance of it. As seen from the XAML, you will need to assign it to a new instance of ModelVisual3D object and then add that instance to Viewport3D objects with (MainViewport is the field that is an instance of Viewport3D):

Private _contentVisual As ModelVisual3D

...

Me._contentVisual = new ModelVisual3D()
Me._viewport3D.Children.Add(_contentVisual)

Doh! simple when you write it like that :) thank you....... plodding on Model now loads :) now i need to reset the view to load another model at the moment i am adding to the scene i would rather clear it an load fresh each time.

Thank you for you help
  


Messages In This Thread
MouseWheelMessageFilter - by GraPhiX - 02-18-2021, 07:20 PM
RE: MouseWheelMessageFilter - by abenedik - 02-19-2021, 10:27 AM
RE: MouseWheelMessageFilter - by GraPhiX - 02-19-2021, 10:35 AM
RE: MouseWheelMessageFilter - by GraPhiX - 02-19-2021, 01:32 PM
RE: MouseWheelMessageFilter - by abenedik - 02-19-2021, 02:14 PM
RE: MouseWheelMessageFilter - by GraPhiX - 02-19-2021, 04:10 PM
RE: MouseWheelMessageFilter - by GraPhiX - 02-19-2021, 07:14 PM
RE: MouseWheelMessageFilter - by abenedik - 02-22-2021, 10:25 AM
RE: MouseWheelMessageFilter - by GraPhiX - 02-22-2021, 11:56 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)