3DTools-1.0-src

所属分类:C#编程
开发工具:C#
文件大小:187KB
下载次数:65
上传日期:2012-07-27 07:52:36
上 传 者MicroPhion
说明:  是WPF实现3D的一个库,也可以到官网上下载
(This is a lib about the 3D tools implented by WPF.)

文件列表:
3DTools-1.0-src\3DTools (0, 2006-12-13)
3DTools-1.0-src\3DTools\3DTools.csproj (3729, 2006-12-13)
3DTools-1.0-src\3DTools\Interactive3DDecorator.cs (39457, 2006-12-13)
3DTools-1.0-src\3DTools\InteractiveVisual3D.cs (52462, 2006-12-13)
3DTools-1.0-src\3DTools\MathUtils.cs (16349, 2006-12-13)
3DTools-1.0-src\3DTools\Matrix3DStack.cs (3224, 2006-12-13)
3DTools-1.0-src\3DTools\MeshUtils.cs (13335, 2006-12-13)
3DTools-1.0-src\3DTools\Properties (0, 2006-12-13)
3DTools-1.0-src\3DTools\Properties\AssemblyInfo.cs (2101, 2006-12-13)
3DTools-1.0-src\3DTools\Properties\Resources.Designer.cs (2841, 2006-12-13)
3DTools-1.0-src\3DTools\Properties\Resources.resx (5618, 2006-12-13)
3DTools-1.0-src\3DTools\Properties\Settings.Designer.cs (1087, 2006-12-13)
3DTools-1.0-src\3DTools\Properties\Settings.settings (203, 2006-12-13)
3DTools-1.0-src\3DTools\ScreenSpaceLines3D.cs (12730, 2006-12-13)
3DTools-1.0-src\3DTools\Trackball.cs (7535, 2006-12-13)
3DTools-1.0-src\3DTools\TrackballDecorator.cs (7211, 2006-12-13)
3DTools-1.0-src\3DTools\Trackport3D.xaml (2163, 2006-12-13)
3DTools-1.0-src\3DTools\Trackport3D.xaml.cs (3855, 2006-12-13)
3DTools-1.0-src\3DTools\ViewMode.cs (715, 2006-12-13)
3DTools-1.0-src\3DTools\Viewport3DDecorator.cs (16542, 2006-12-13)
3DTools-1.0-src\3DTools.sln (3681, 2006-12-13)
3DTools-1.0-src\3DTools.suo (92910, 2006-12-13)
3DTools-1.0-src\Samples (0, 2006-12-13)
3DTools-1.0-src\Samples\Channel9Demo (0, 2006-12-13)
3DTools-1.0-src\Samples\Channel9Demo\App.xaml (750, 2006-12-13)
3DTools-1.0-src\Samples\Channel9Demo\App.xaml.cs (889, 2006-12-13)
3DTools-1.0-src\Samples\Channel9Demo\Channel9Demo.csproj (3944, 2006-12-13)
3DTools-1.0-src\Samples\Channel9Demo\DemoWindow.xaml (7647, 2006-12-13)
3DTools-1.0-src\Samples\Channel9Demo\DemoWindow.xaml.cs (1192, 2006-12-13)
3DTools-1.0-src\Samples\Channel9Demo\Properties (0, 2006-12-13)
3DTools-1.0-src\Samples\Channel9Demo\Properties\AssemblyInfo.cs (2070, 2006-12-13)
3DTools-1.0-src\Samples\Channel9Demo\Properties\Resources.cs (2403, 2006-12-13)
3DTools-1.0-src\Samples\Channel9Demo\Properties\Resources.resx (5618, 2006-12-13)
3DTools-1.0-src\Samples\Channel9Demo\Properties\Settings.cs (1373, 2006-12-13)
3DTools-1.0-src\Samples\Channel9Demo\Properties\Settings.settings (203, 2006-12-13)
3DTools-1.0-src\Samples\GeneratedTextureCoordinatesDemo (0, 2006-12-13)
3DTools-1.0-src\Samples\GeneratedTextureCoordinatesDemo\App.xaml (318, 2006-12-13)
3DTools-1.0-src\Samples\GeneratedTextureCoordinatesDemo\App.xaml.cs (311, 2006-12-13)
3DTools-1.0-src\Samples\GeneratedTextureCoordinatesDemo\GeneratedTextureCoordinatesDemo.csproj (4041, 2006-12-13)
... ...

This README gives a brief overview of the major classes used to enable interactive 2D on 3D, a high level overview of how it works, as well as a list of known issues and changes that can be made to get around them. --------------- Class Overview: --------------- There are three main classes that are used to enable interacting with 2D content on 3D objects: Viewport3DDecorator, Interactive3DDecorator and InteractiveVisual3D. As a client of the 2D on 3D code, only Interactive3DDecorator and InteractiveVisual3D need to be used. These three classes are explained next. Viewport3DDecorator: -------------------- The Viewport3DDecorator is used to extend the functionality of a Viewport3D. It does so by allowing UIElements to be placed in front of and behind the Viewport3D that is being decorated. This enables, for instance, the Interactive3DDecorator to place its hidden layer on top of the Viewport3D it is decorating, or the trackball to put a pane of glass beneath the Viewport3D it is decorating, so it can be notified when the mouse is clicked within the bounds of the Viewport3D. The UIElements that occur in front of and behind the Viewport3D are exposed via the PreViewportChildren and PostViewportChildren dependency properties. The Viewport3D or Viewport3DDecorator that is decorated is exposed via the Content property of the class. The class takes care of laying out all of its children, but this can be overridden by derived classes if desired. Interactive3DDecorator: ----------------------- The Interactive3DDecorator is a subclass of the Viewport3DDecorator, and uses its PostViewportChildren property to position the hidden visual layer which actually provides the interaction. This class provides interactivity to a Viewport3D. In XAML, the Interactive3DDecorator is used as follows: InteractiveVisual3D: -------------------- The final class, the InteractiveVisual3D, is used to create the interactive 3D content and also to signal to the Interactive3DDecorator that this Visual3D is intended to be interacted with. InteractiveVisual3D is a subclass of ModelVisual3D and provides the following dependency properties: Geometry - The Geometry3D that is to become the content of the InteractiveVisual3D. Visual – The Visual that is to be used in a VisualBrush, which will then be used in a material for the geometry for the InteractiveVisual3D. Material – A user specified material, with the IsInteractiveMaterial attached property being used to mark the locations where the user wants the VisualBrush used to represent the Visual, to be placed. By default, a DiffuseMaterial is used. IsBackVisible – Indicates whether the material used for the front face should also be mirrored on the back face. The first two properties, Geometry and Visual, are the primary ones needed. They allow the geometry for the Visual3D to be set, as well as the Visual that should appear on that geometry. Note: the texture coordinates used for the Geometry must be in the range (0,0) to (1,1) to enable interaction with the Visual. If they are outside this range, the user will be interacting outside of the bounds of the Visual. The others allow for fine tuning of the object’s appearance. The Material property allows a user to create their own material for the object. Because there potentially need to be things added above the Visual specified by the user, and because parameters of the VisualBrush are modified, the user does not directly specify the VisualBrush used. Instead, they specify using the IsInteractiveMaterial attached property, which material they wish to make “interactive” (i.e. set the VisualBrush created using the passed in Visual as the Brush for that material). As an example, the following code sets the material to be composed of a DiffuseMaterial, which will contain the visual brush, and a SpecularMaterial. Finally, IsBackVisible sets the material used on the front face to also be used on the back face. Currently, the Interactive3DDecorator does not distinguish between front and back faces, so this allows for there to be interaction with the back face as well. The following is an example use of the InteractiveVisual3D in XAML:

近期下载者

相关文件


收藏者