AB4D Forum
3D Binding - 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: 3D Binding (/showthread.php?tid=42)



3D Binding - niannott - 06-17-2010

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


RE: 3D Binding - abenedik - 10-18-2011

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>