在Visual Studio 2017中使用3D Wavefront OBJ / STL

时间:2018-07-26 08:13:40

标签: c# wpf 3d blend wavefront

我想将your_app/app/views/rails_admin/main/_delete_notice.html.hamlWavefront OBJ文件导入到我的STL应用程序中。

在较早的帖子上有我无法使用的演练。

是否不再可能“轻松”导入这些文件并在 VisualStudio / Blend 2017 中使用它?


我找到了C# WPF的教程,并成功导入了一些文件:

但这对我来说似乎不是完美的方式。我想做的是从HelixToolkit.WPF导出计算机的零件,将其放入我的应用程序,并为我的计算机创建3D可视化。

应该可以在SolidWorks中看到我的对象!

1 个答案:

答案 0 :(得分:1)

我用Scichart WPF将一些Solidworks零件导入WPF,使用起来有点麻烦,但是你会得到你想要的,但是scichart不能制作动画,你只能有30天的试用期。 下面是一个例子:

<s3D:SciChart3DSurface Name="sciChart3DSurface"
                   Grid.Column="1"
                   WorldDimensions="250,1,250">

<s3D:SciChart3DSurface.Resources>
    <!--  The 3D chess objects models which are used in this example were created by Fabio Valle, objects are used for  -->
    <!--  demonstrating purposes only to show possibility how to load and manipulate the 3D objects on 3D scene. Fabio's email: fabiovalle3d@gmail.com  -->
    <object:ObjectModelSource x:Key="PawnLowObj3DSource" Source="pack://application:,,,/SciChart.Examples.ExternalDependencies;component/Resources/Objects/Pawn_Low.obj"/>
    <object:ObjectModelSource x:Key="BishopLowObj3DSource" Source="pack://application:,,,/SciChart.Examples.ExternalDependencies;component/Resources/Objects/Bishop_Low.obj"/>
    <object:ObjectModelSource x:Key="KingLowObj3DSource" Source="pack://application:,,,/SciChart.Examples.ExternalDependencies;component/Resources/Objects/King_Low.obj"/>
    <object:ObjectModelSource x:Key="KnightLowObj3DSource" Source="pack://application:,,,/SciChart.Examples.ExternalDependencies;component/Resources/Objects/Knight_Low.obj"/>
    <object:ObjectModelSource x:Key="QueenLowObj3DSource" Source="pack://application:,,,/SciChart.Examples.ExternalDependencies;component/Resources/Objects/Queen_Low.obj"/>
    <object:ObjectModelSource x:Key="RookLowObj3DSource" Source="pack://application:,,,/SciChart.Examples.ExternalDependencies;component/Resources/Objects/Rook_Low.obj"/>
    <object:Rotation3D x:Key="ObjRotationState" Axis="YAxis" Angle="180" />
    <object:TextureSource x:Key="BlackTexture" Source="pack://application:,,,/SciChart.Examples.ExternalDependencies;component/Resources/Objects/BlackWoodTexture.jpg" />
    <object:TextureSource x:Key="WhiteTexture" Source="pack://application:,,,/SciChart.Examples.ExternalDependencies;component/Resources/Objects/WhiteWoodTexture.jpg" />
</s3D:SciChart3DSurface.Resources>

<s3D:SciChart3DSurface.SceneObjects>
    <!--  The 3D chess objects models which are used in this example were created by Fabio Valle, objects are used for  -->
    <!--  demonstrating purposes only to show possibility how to load and manipulate the 3D objects on 3D scene. Fabio's email: fabiovalle3d@gmail.com  -->
    ...
    <object:ObjectModel3D TextureSource="{StaticResource BlackTexture}" Source="{StaticResource RookLowObj3DSource}" Position="0.0625, 0.6, 0.9375" CoordinateMode="Relative" Scale="0.2, 0.2, 0.2"/>
    <object:ObjectModel3D TextureSource="{StaticResource BlackTexture}" Source="{StaticResource KnightLowObj3DSource}" Position="0.0625, 0.6, 0.8125" CoordinateMode="Relative" Scale="0.2, 0.2, 0.2" Rotation="{StaticResource ObjRotationState}"/>
    <object:ObjectModel3D TextureSource="{StaticResource BlackTexture}" Source="{StaticResource BishopLowObj3DSource}" Position="0.4375, 0.6, 0.3125" CoordinateMode="Relative" Scale="0.2, 0.2, 0.2" Rotation="{StaticResource ObjRotationState}"/>
    <object:ObjectModel3D TextureSource="{StaticResource BlackTexture}" Source="{StaticResource KingLowObj3DSource}" Position="0.0625, 0.6, 0.5625" CoordinateMode="Relative" Scale="0.2, 0.2, 0.2"/>
    <object:ObjectModel3D TextureSource="{StaticResource BlackTexture}" Source="{StaticResource QueenLowObj3DSource}" Position="0.0625, 0.6, 0.4375" CoordinateMode="Relative" Scale="0.2, 0.2, 0.2" Rotation="{StaticResource ObjRotationState}"/>
    <object:ObjectModel3D TextureSource="{StaticResource BlackTexture}" Source="{StaticResource BishopLowObj3DSource}" Position="0.0625, 0.6, 0.3125" CoordinateMode="Relative" Scale="0.2, 0.2, 0.2" Rotation="{StaticResource ObjRotationState}"/>
    <object:ObjectModel3D DrawBoundingBox="True" BoundingBoxStroke="White" TextureSource="{StaticResource BlackTexture}" Source="{StaticResource KnightLowObj3DSource}" Position="0.3125, 0.6, 0.3125" CoordinateMode="Relative" Scale="0.2, 0.2, 0.2" Rotation="{StaticResource ObjRotationState}"/>
    <object:ObjectModel3D TextureSource="{StaticResource BlackTexture}" Source="{StaticResource RookLowObj3DSource}" Position="0.0625, 0.6, 0.0625" CoordinateMode="Relative" Scale="0.2, 0.2, 0.2"/>
    ...
</s3D:SciChart3DSurface.SceneObjects>

这是一个演示图片: enter image description here