天道酬勤,学无止境

helix-3d-toolkit

How do you rotate a 3D model using HelixToolkit?

I need some help rotating a 3D model in a WPF project on visual studios. I have imported the model in through the use of the helix toolkit. But I can not find any example of how to rotate the 3D model online. I've found some C# and xaml examples but they mainly seem to rotate the camera not the model.

2021-10-22 03:32:20    分类:问答    c#   wpf   helix-3d-toolkit

Why rendering image in code behind do not work?

I'm trying to generate screenshot from helix control but only in code behind - why this not work? Something is missing? private void generate() { ModelImporter importer = new ModelImporter(); Model3D model = importer.Load(@"c:\test\test.obj"); Model3DGroup group = new Model3DGroup(); group.Children.Add(model); ModelVisual3D myModelVisual3D = new ModelVisual3D(); myModelVisual3D.Content = group; HelixViewport3D viewer = new HelixViewport3D(); viewer.Children.Add(myModelVisual3D); Dispatcher.BeginInvoke(new Action(() => { RenderTargetBitmap bmp = new RenderTargetBitmap(1024, 768, 96, 96

2021-10-20 17:01:32    分类:问答    c#   helix-3d-toolkit

How to resolve synchronisation problem with Helix Toolkit rendering on WPF composite render thread

C#, WPF, Helix Toolkit. I am trying to generate a bitmap from a HelixViewport3D and have encountered a few problems. The first problem is that I cannot find a way to render off-screen. There are a few references to this online (e.g. here) and as far as I can see it does not have a built-in solution. As a somewhat sub-optimal workaround I have proceeded to render to the screen where the user can see it, with the intention of creating a bitmap from that rendered image. I now have the problem that an image exported from the content on screen (e.g. using Viewport3DHelper.SaveBitmap) is blank if I

2021-10-20 09:48:23    分类:问答    c#   wpf   multithreading   helix-3d-toolkit

Asynchronous operations within a loop - how to keep control of execution?

Follow-on question to this one. I am trying to generate and save a series of images. Rendering is done by Helix Toolkit, which I am told utilises the WPF composite render thread. This is causing problems because it executes asynchronously. My original problem was that I couldn't save a given image because it hadn't yet been rendered at that time I was trying to save it. The above answer provides a workaround to this by putting the 'save' operation inside an Action which is called with low priority, thus ensuring that the rendering completes first. This is fine for one image, but in my

2021-10-20 06:47:50    分类:问答    c#   wpf   multithreading   asynchronous   helix-3d-toolkit

Helix Sharp DX 中的灯光无法正常工作(Lights not working properly in Helix Sharp DX)

问题 我正在尝试使用带有 SharpDX 的 Helix Toolkit (https://github.com/helix-toolkit/helix-toolkit) 构建一个 obj 文件查看器。 到目前为止,我能够加载一个对象文件并将其内容渲染到 Helix Viewport3DX。 模型在某些 obj 文件中看起来不错,但对于其他文件,则存在一些闪电问题,并且背面始终是黑色的。 我不确定我做错了什么。 是不是SharpDX不支持背材造成的光线问题?? 请帮忙。 使用 Helix Sharp DX 的问题: Adobe DC Reader 中的原始模型如下所示: Viewport3DX 设置为: <Window.Resources> <DataTemplate x:Key="Template1"> <hx:MyMeshGeometryModel3D Geometry="{Binding Geometry}" Transform="{Binding Transform}" Material="{Binding Material}"/> </DataTemplate> <hx:RenderTechniqueConverter x:Key="RenderTechniqueConverter"/> </Window.Resources> <hx:Viewport3DX x:Name

2021-10-20 04:55:07    分类:技术分享    directx-11   directx-9   sharpdx   directx-10   helix-3d-toolkit

Lights not working properly in Helix Sharp DX

I am trying to build an obj file viewer using Helix Toolkit (https://github.com/helix-toolkit/helix-toolkit) with SharpDX. So far I am able to load an object file and render it's contents to Helix Viewport3DX. Model looks good with some obj files but for others there are some lightning problem and back surfaces are always black. I am not sure what am I doing wrong. Is this light problem due to the fact that SharpDX does not support back materials?? Please help. Problem using Helix Sharp DX: Original Model in Adobe DC Reader looks like this: Viewport3DX settings are: <Window.Resources>

2021-10-19 11:03:37    分类:问答    directx-11   directx-9   sharpdx   directx-10   helix-3d-toolkit

带有 Helix 工具包的 WPF,带有代码隐藏的动画?(WPF with Helix toolkit, animate with code-behind?)

问题 我是 WPF 的新手,正在尝试使用螺旋工具包构建 3d 视口。 视口、网格等按预期显示,我添加了一个简单的管。 现在,我想使用一个新函数根据用户输入更新管的变换,但我无法让它工作。 我哪里出错了? 谢谢你。 .xaml <UserControl x:Class="WPFUserControl.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:HelixToolkit="clr-namespace:HelixToolkit.Wpf;assembly=HelixToolkit.Wpf" mc:Ignorable="d" d:DesignHeight="480" d:DesignWidth="640"> <Grid> <!-- The HelixViewport3D supports

2021-10-15 00:36:45    分类:技术分享    c#   wpf   xaml   helix-3d-toolkit

WPF with Helix toolkit, animate with code-behind?

I am new to WPF, and am trying to build a 3d viewport with helix toolkit. The viewport, grid etc show up as expected, And I add a simple tube. Now, i want to use a new function to update the Transform of the tube, based on user input, but I cannot get it to work. Where am i going wrong here? Thank you. .xaml <UserControl x:Class="WPFUserControl.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com

2021-10-12 06:30:24    分类:问答    c#   wpf   xaml   helix-3d-toolkit

在 WPF 应用程序中旋转 HelixViewport3D 中的对象(Rotate an object in HelixViewport3D in a WPF app)

问题 我正在尝试使用 helixtoolkit 在 WPF 应用程序中显示 3d 对象,并根据 3 个变量(用户输入)沿 x、y、z 轴旋转它。 但是我在螺旋工具包中找不到旋转 3d 对象的函数。 C#代码 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using System.Windows.Media.Media3D; using HelixToolkit.Wpf; namespace HelixTrial { public partial class MainWindow

2021-09-18 23:06:49    分类:技术分享    c#   wpf   helix-3d-toolkit

如何将 MeshElement3D 显示为线框?(How to display MeshElement3D as wireframe?)

问题 我想将 helix-toolkit 中的任何 MeshElement3D(例如 BoxVisual3d)显示为线框。 如何做到这一点? 编辑: 感谢 Erno de Weerd 的回答,我能够编写以下代码 扩展 BoxVisual3D 的类public class GeometryBoxVisual3D : BoxVisual3D { public MeshGeometry3D Geometry() { return Tessellate(); } } 将 box 的实例添加到视口: GeometryBoxVisual3D box = new GeometryBoxVisual3D(); box.Fill = new SolidColorBrush(Colors.Red); Viewport3D.Children.Add(box); MeshGeometry3D geometry3 = box.Geometry(); LinesVisual3D lines = new LinesVisual3D(); lines.Thickness = 3; lines.Points = geometry3.Positions; lines.Transform = new TranslateTransform3D(3,1,1); Viewport3D.Children.Add(lines)

2021-09-18 16:08:55    分类:技术分享    wpf   helix-3d-toolkit