Container3D Control
A Container3D control generates three dimensional (3D) models within a WPF scene. The control collects the objects supplied either explicitly through an Items property or via data binding a data collection to an ItemSource property. Once the objects are collected, 3D models for each of the collected objects are dynamically generated along with a 3D transform indicating the position of the generated 3D models. The 3D transform is used to determine positions in the WPF scene for each 3D model.
1 . A method for generating 3D models for a scene from a collection of objects, the method comprising:
collecting a plurality of objects;
generating 3D models for each of the collected plurality of objects;
calculating a 3D transform indicating a position of the generated 3D models; and
setting a transform that positions the generated 3D models in virtual space for each of the generated models to the position indicated by the 3D transform.
2 . The method as recited in claim 1 wherein the plurality of objects are collected explicitly through an Items property.
3 . The method as recited in claim 1 wherein the plurality of objects are collected via a data binding to a data collection.
4 . The method as recited in claim 1 wherein when a first time the position is indicated the generated 3D models are added to the scene.
5 . The method as recited in claim 1 wherein when the position is indicated a second time, the generated 3D models are repositioned on the scene.
6 . A method for generating 3D models with a container 3D control for a scene from a plurality of objects in Windows Presentation Foundation (WPF), the method comprising:
referencing a layout control and a generator control;
providing the plurality of objects to be collected;
invoking the generator control to generate 3D models for each of the collected plurality of objects;
invoking the layout control to calculate a 3D transform indicating the position of the generated 3D models; and
setting a transform that positions the generated 3D models in the scene for each of the generated 3D models.
7 . The method as recited in claim 6 , further comprising adding a container3D control to a node within the scene.
8 . The method as recited in claim 6 wherein the transform positions the generated 3D models at the position calculated by the layout control.
9 . The method as recited in claim 6 wherein the plurality of objects are collected explicitly through an Items property.
10 . The method as recited in claim 6 wherein the plurality of objects are collected via a data binding to a data collection.
11 . The method as recited in claim 6 wherein when a first time the position is calculated the generated 3D models are added to the scene.
12 . The method as recited in claim 6 wherein when the position is calculated a second time, the generated 3D models are repositioned on the scene.
13 . A computer readable medium comprising computer-executable instructions for generating 3D models for a scene from a collection of objects that, when executed by one or more processors, perform acts comprising:
collecting a plurality of objects;
generating models for each of the collected plurality of objects;
calculating a transform indicating a position of the generated models; and
setting a transform that positions the generated models in virtual space for each of the generated models to the position indicated by the transform.
14 . The computer readable medium as recited in claim 1 wherein when a first time a transform is set the generated 3D models are added to the scene.
15 . The computer readable medium as recited in claim 13 wherein when a second time the transform is set, the generated 3D models are repositioned on the scene.
16 . The computer readable medium as recited in claim 13 , wherein the acts are performed using Window Presentation Foundation.