提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
声明:本产品中文介绍为慧都网版权所有,未经慧都公司书面许可,严禁拷贝、转载!
* 关于本产品的分类与介绍仅供参考,精准产品资料以官网介绍为准,如需购买请先行测试。
该库的主要部分是:
Cameras (SceneCamera, FirstPersonCamera, ThirdPersonCamera, 等)
Camera Controllers (MouseCameraController, CameraControlPanel)
3D Models and Visuals (Sphere, Box, Cylinder,等)
3D Lines
Event Manager 3D (简化了3D对象的事件处理)
Cameras, 3D Models和Lines可以在XAML中定义。并且结果能够马上就显示在Visual Studio Designer(可视化工作室设计器)中。
使用Ab3d.PowerToys进行3D编程式在容易不过了!
Cameras 与 Camera Controllers
该库定义了一些新的Cameras,它能被用于代替目前WPF的摄像头。Ab3d Cameras与WPFcameras的主要区别是,Ab3d Cameras不需要使用Vectors来定义LookDirection,而是利用角度来定义它。这使得更自然。例如,如果您想查看的场景需要偏上和偏右一点点,您只需要定义Heading角度为30度和Attitude角度为-45度。您也可以定义场景的Distance。对于Ab3d Cameras最重要的是:SceneCamera, FirstPersonCamera 和ThirdPersonCamera。所有的Ab3d Cameras及他们的属性能够在类图上可以看到。
Camera Controllers用于控制摄像头。MouseCameraController能够被用于使用鼠标改变摄像头的角度和距离。这种方法可以非常简单的左右旋转摄像头。CameraControlPanel显示的漂亮按钮用于旋转摄像头和移动摄像头的远近。这里还有一个CameraPreviewPanel,它可以图形化地显示当前摄像机正在注视的对象或场景。
下面的代码展示的是一个WPF应用程序只需要几行xaml代码就可以使用摄像头来显示整个场景(SceneCamera)并能够通过鼠标(MouseCameraController)或通过漂亮按钮(CameraControlPanel)旋转摄像头。这里还有一个摄像头的预览,它显示摄像头特定的角度的注视的场景。此外,如果WindGeneratorModel模型不包含灯光,一个摄像头的灯光会自定地被添加当场景中并从摄像头的位置照亮场景(ShowCameraLight=”Auto”)。
01.<Window x:Class="Ab3d.PowerToys.Samples.Window1"
02.xmlns="//schemas.microsoft.com/winfx/2006/xaml/presentation"
03.xmlns:x="//schemas.microsoft.com/winfx/2006/xaml"
04.xmlns:cameras="clr-namespace:Ab3d.Cameras;assembly=Ab3d.PowerToys"
05.xmlns:ab3d="clr-namespace:Ab3d.Controls;assembly=Ab3d.PowerToys">
06. <Grid>
07. <Viewport3D Name="MainViewport3D">
08. <ModelVisual3D Content="{StaticResource WindGeneratorModel}"/>
09. </Viewport3D>
10.
11. <cameras:SceneCamera Name="SceneCamera1"
12. Heading="30"
13. Attitude="-30"
14. Distance="3" IsDistancePercent="True"
15. IsDynamicTarget="True"
16. ShowCameraLight="Auto"/>
17.
18. <ab3d:MouseCameraController TargetCameraName="SceneCamera1"
19. IsMouseWheelZoomEnabled="True"/>
20.
21. <ab3d:CameraControlPanel TargetCameraName="SceneCamera1"
22. VerticalAlignment="Bottom"
23. HorizontalAlignment="Left"/>
24.
25. <ab3d:CameraPreviewPanel TargetCameraName="SceneCamera1"
26. Width="100" Height="100"
27. VerticalAlignment="Bottom"
28. HorizontalAlignment="Right"/>
29. </Grid>
30.</Window>
EventManager3D
EventManager3D类是一个辅助类,它可是使得用户能够简单地预定3D对象上的鼠标事件。支持一下鼠标事件:ouseEnter, MouseLeave, MouseDown, MouseUp, MouseClick, BeginMouseDrag, MouseDrag, EndMouseDrag and MouseDoubleClick。这样您就不需要做复杂的3D冲击测试了。EventManager3D也是比WPF的ModelUIElement3D更好,因为它支持更多的鼠标事件(包括鼠标在3D中的拖放),提供更好的事件数据并保存3D模型的结构。这样您的编码更简单,更好组织。
下面的代码显示的是一个使用EventManager3D的样例:
01.
02.ModelEventSource3D eventSource;
03.EventManager3D eventManager;
04.
05.eventManager = new ModelEventSource3D(MainViewport);
06.
07.
08.eventSource = new EventSource3D();
09.eventSource.TargetModel3D = myButton3D;
10.eventSource.MouseClick += new MouseButton3DEventHandler(myButton3D_MouseClick);
11.
12.eventManager.RegisterEventSource3D(eventSource);
13.
14.
15.eventSource = new ModelEventSource3D();
16.eventSource.TargetModel3D = myMovableObject3D;
17.eventSource.BeginMouseDrag += new Mouse3DEventHandler(myMovableObject3D_BeginMouseDrag);
18.eventSource.MouseDrag += new MouseDrag3DEventHandler(myMovableObject3D_MouseDrag);
19.eventSource.EndMouseDrag += new Mouse3DEventHandler(myMovableObject3D_EndMouseDrag);
20.
21.eventManager.RegisterEventSource3D(eventSource);
3D Models
Ab3d.PowerToys库还包含一些类用于以代码或XAML来创建基本的3D模型。它可以创建Plane(平面), Circle(圆), Box(箱), Pyramid(金字塔), Sphere(球), Cone(圆锥)和Cylinder(圆柱)3D模型。
下面的XAML创建了一些3D对象:WireGrid, 3D Sphere, 3D Box和3D Cone。需要注意的是Sphere也拥有ToolTip定义。另一件有趣的事情是通过提供的颜色的名字定义Materials.
01.
02.<Page x:Class="Ab3d.PowerToys.Samples.Objects3D.UIElementsToolTipSample"
03. xmlns="//schemas.microsoft.com/winfx/2006/xaml/presentation"
04. xmlns:x="//schemas.microsoft.com/winfx/2006/xaml"
05. xmlns:cameras="clr-namespace:Ab3d.Cameras;assembly=Ab3d.PowerToys"
06. xmlns:visuals="clr-namespace:Ab3d.Visuals;assembly=Ab3d.PowerToys"
07. xmlns:uiElements="clr-namespace:Ab3d.UIElements;assembly=Ab3d.PowerToys">
08. <Grid>
09. <Viewport3D Name="MainViewport">
10. <visuals:WireGridVisual3D CenterPosition="0 0 0" Size="70 30"
11. WidthCellsCount="7" HeightCellsCount="3"
12. LineColor="Gray" LineThickness="2"/>
13.
14. <uiElements:SphereUIElement3D CenterPosition="-20 5 0"
15. Radius="5"
16. Material="Green"
17. ToolTip="This is a simple tooltip"/>
18.
19. <uiElements:BoxUIElement3D CenterPosition="20 5 0"
20. Size="10 10 10"
21. Material="Red"/>
22.
23. <visuals:ConeVisual3D BottomCenterPosition="0 0 0"
24. BottomRadius="5" TopRadius="2"
25. Height="10" Segments="6"
26. IsSmooth="False" Material="Blue"/>
27. </Viewport3D>
28.
29. <cameras:SceneCamera Heading="30" Attitude="-20" Bank="0"
30. Distance="100" ShowCameraLight="Always"/>
31. </Grid>
32.</Page>
下面的图像显示的是能够通过Ab3d.PowerToys创建的几乎所有的3D对象。该图像显示的3D对象在Design Time in Visual Studio一直可见。这里还有一些Ab3d.PowerToys项在工具箱中(不幸地是它不能在Toolbox中显示3D对象)。属性编辑器显示的当前被选定的ConeVisual3D的属性。
下面的图像时摘自一个球形样例,它显示的是一个在3D球形上绘制三角形和法线。对于该球形的相关设置显示在图像的右下角。
3D Lines
另外,还支持具有优化机制的3D Lines。它使得为WPF提供更先进的和具有更好性能的3Dlines实现。
Ab3d.PowerToys is the ultimate helper library for work with WPF 3D.
The main parts of the library are:
Cameras, 3D Models and Lines can be defined in XAML. The results are immediately shown in Visual Studio Designer.
With Ab3d.PowerToys programming with 3D cannot be easier!
Cameras and Camera Controllers
The library defines a few new Cameras that can be used instead of the current WPF's cameras. The main difference between Ab3d Cameras and WPF cameras is that Ab3d Cameras does not use Vectors to define the LookDirection, but instead use angles in degrees to define it. This is much more natural. For example if you want to look at the scene a little bit from the right and from above, you just define the Heading to be 30 and Attitude to be -45. You can also define the Distance from the scene. The most important Ab3d Cameras are: SceneCamera, FirstPersonCamera and ThirdPersonCamera. All the Ab3d Cameras with their properties can be seen on the class diagram.
Camera Controllers are used to control the camera. The MouseCameraController can be used to change the angle and distance of the camera with the mouse. This way it is very simple to rotate the camera around. The CameraControlPanel shows nice buttons to rotate the camera and move the camera closer or farther away. There is also a CameraPreviewPanel that graphically shows at which angle the camera is looking at the object or scene.
The following code demonstarates that with only a few lines of xaml a WPF application can use a camera that is showing the whole scene (SceneCamera) and can be rotated by the mouse (MouseCameraController) or by nice buttons (CameraControlPanel). There is also a preview of the camera that is showing from which angle the camera is looking at the scene. Also if the WindGeneratorModel model does not contain a light, a camera light is automatically added to the scene and it is iluminating the scene from the camera's position (ShowCameraLight="Auto").
EventManager3D
The EventManager3D class is a helper class that enables user to simply subscribe to mouse events on 3D objects. The following mouse events are supported: MouseEnter, MouseLeave, MouseDown, MouseUp, MouseClick, BeginMouseDrag, MouseDrag, EndMouseDrag and MouseDoubleClick. This way you do not need to do the complicated 3D hit testing any more. The EventManager3D is also better than WPF's ModelUIElement3D because it supports more mouse events (including mouse drag in 3D), provides better event data and preserves the structure of the 3D models. This way your code is much simpler and better organized.
The following code shows a sample used of EventManager3D:
3D Models
The Ab3d.PowerToys library also contains classes to create basic 3D models in code or XAML. It is possible to create Plane, Circle, Box, Pyramid, Sphere, Cone and Cylinder 3D models.
The following XAML creates some of the 3D objects: WireGrid, 3D Sphere, 3D Box and 3D Cone. Note that the Sphere also has a ToolTip defined. Another interesting thing that is that the Materials are defined only by providing the name of the Color.
The following image shows almost all the 3D objects that can be created with Ab3d.PowerToys. The image shows that the 3D objects are already visible at Design Time in Visual Studio. There are also some Ab3d.PowerToys item in Toolbox (unfortunatlly it is not possible to show 3D objects in Toolbox). The Property Editor shows the properties for the currently selected ConeVisual3D.
The following image is taken from Sphere sample and shows the 3D sphere with drawn triangles and normals. The settings for the sphere are shown on the lower right part of the image.
3D Lines
There is also support for 3D Lines with optimized update mechanism that make the 3D lines implementation the most advanced and with the best performance for WPF.
更新时间:2022-10-20 10:21:07.000 | 录入时间:2010-04-29 15:08:11.000 | 责任编辑:何家巧
高质量2D/3D文档查看器,提供专业的浏览、编辑和转换功能,支持30多种光栅和矢量图形格式
DWGSee清新快速的 dwg 阅读器,可以浏览,查看,测量,打印 DWG, DXF, DWF 文件
Ab3d.DXEngineAb3d.DXEngine是可以在.Net Desktop应用程序中使用的快速3D渲染引擎
Sketch交互式跨平台多人在线矢量图原型绘制软件
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@pclwef.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢