3D Binding
#1
Hello Again,

Is it possible to bind any (or a collection of) the 3D models to a Viewport3D? In my case I'm generating models based on an input file and it would be very helpful to not have to add each model in code.

Thanks again,

Nick
#2
I am not sure that I know what do you mean by "generating models based on an input file".

If your 3D model are defined in resources, it is possible to bind to them.
It is also possible to define Ab3d.Reader3ds in the resources and than bind the read model to Viewport3D.

For example (taken from Ab3d.Reader3ds samples):
Code:
<Page.Resources>
    <ab3d:Reader3ds x:Key="MyReader3ds" Source="/Resources/robotarm.3ds"/>
</Page.Resources>
<Grid>
    <Viewport3D Name="MainViewport"
                Camera="{Binding Source={StaticResource MyReader3ds}, Path=Cameras[0]}">
        <ModelVisual3D Content="{Binding Source={StaticResource MyReader3ds}, Path=RootModel3DGroup}"/>
    </Viewport3D>
</Grid>
Andrej Benedik
  


Forum Jump:


Users browsing this thread:
1 Guest(s)