Comments (12)
https://github.com/helix-toolkit/helix-toolkit/tree/develop/Source/Examples/WPF.SharpDX/FileLoadDemo. If you don't use wpf binding, you can just do Viewport3DX.Items.Add(groupModel)
.
from helix-toolkit.
Not sure what you mean by blocking the entire window.
from helix-toolkit.
Hi , sorry if my question is not clear.
I use a panel form in Rhino3d software.
This is the code i used but the viewport always black and if i click on it the entire window of Rhino freeze.
............
private System.Windows.Controls.Viewbox viewbox;
private HelixToolkit.Wpf.SharpDX.Viewport3DX viewport3d;
this.elementHost2 = new System.Windows.Forms.Integration.ElementHost();
this.viewbox = new System.Windows.Controls.Viewbox();
.....
this.elementHost2.Child = this.viewbox;
..............
public RHViewerUserControl()
{
InitializeComponent();
this.Load += MainForm_Load;
AmbientLight3D ambientLight = new AmbientLight3D();
viewport3d = new Viewport3DX();
viewport3d.Name = "view";
viewport3d.Width = 400;
viewport3d.Height = 400;
viewport3d.ZoomExtentsWhenLoaded = true;
viewport3d.BackgroundColor = System.Windows.Media.Color.FromRgb(200, 200, 200);
viewport3d.ShowViewCube = true;
viewport3d.Orthographic = false;
/*/
viewport3d.Camera = new HelixToolkit.Wpf.SharpDX.PerspectiveCamera
{
Position = new Point3D(0.0, 0.0, 5.0),
LookDirection = new System.Windows.Media.Media3D.Vector3D(0.0, 0.0, -5.0),
UpDirection = new System.Windows.Media.Media3D.Vector3D(0.0, 1.0, 0.0),
NearPlaneDistance = 0.5,
FarPlaneDistance = 150.0
};
/*/
viewport3d.Visibility = Visibility.Visible;
viewbox.Child = viewport3d;
......
}
private string OpenFileFilter = $"{HelixToolkit.Wpf.SharpDX.Assimp.Importer.SupportedFormatsString}";
SceneNodeGroupModel3D groupModel = new SceneNodeGroupModel3D();
private void button4_Click(object sender, EventArgs e)
{
string filePath = OpenFileDialog(OpenFileFilter);
var loader = new HelixToolkit.Wpf.SharpDX.Assimp.Importer();
var scene = loader.Load(filePath);
groupModel.Clear();
/*/
foreach (var node in scene.Root.Traverse().ToList())
{
node.RemoveSelf(); // remove from scene to be able to add to group
groupModel.AddNode(node);
}
/*/
scene.Root.Attach(viewport3d.EffectsManager); // Pre attach scene graph
scene.Root.UpdateAllTransformMatrix();
groupModel.AddNode(scene.Root);
}
private string OpenFileDialog(string filter)
{
var d = new Microsoft.Win32.OpenFileDialog();
d.CustomPlaces.Clear();
d.Filter = filter;
if (!d.ShowDialog().Value)
{
return null;
}
return d.FileName;
}
from helix-toolkit.
Are you able to upload a sample project? I am not familiar with the rhino3D.
from helix-toolkit.
It's just windows form with c# code, i want know how it work in c# and windows form.
The example available use wpf and i try to implant the code in my form without success, or if there is an example using windows form this will be very helpful
from helix-toolkit.
HelixViewport3D works fine , but i prefer SharpDX.Viewport3DX to load more object with assimp
Recording.2024-05-11.171017.mp4
from helix-toolkit.
I add this to solve the problem of black background
assimpviewport3d.EffectsManager = new DefaultEffectsManager();
But i still to find a way how to import objects with assimp
private string OpenFileFilter = $"{HelixToolkit.Wpf.SharpDX.Assimp.Importer.SupportedFormatsString}";
SceneNodeGroupModel3D groupModel = new SceneNodeGroupModel3D();
private string OpenFileDialog(string filter)
{
var d = new Microsoft.Win32.OpenFileDialog();
d.CustomPlaces.Clear();
d.Filter = filter;
if (!d.ShowDialog().Value)
{
return null;
}
return d.FileName;
}
private void assimpLoadButton_Click(object sender, EventArgs e)
{
string filePath = OpenFileDialog(OpenFileFilter);
var loader = new HelixToolkit.Wpf.SharpDX.Assimp.Importer();
var scene = loader.Load(filePath);
groupModel.Clear();
foreach (var node in scene.Root.Traverse().ToList())
{
node.RemoveSelf(); // remove from scene to be able to add to group
groupModel.AddNode(node);
}
scene.Root.Attach(assimpviewport3d.EffectsManager); // Pre attach scene graph
scene.Root.UpdateAllTransformMatrix();
groupModel.AddNode(scene.Root);
}
from helix-toolkit.
Did you bind your groupModel in the viewport?
from helix-toolkit.
That's the problem
i don't know how to add the model to the viewport, i search a lot and don't find any example in c#
from helix-toolkit.
Thank you Finally it work
Is fbx animation loaded automatically or it need complex steps?
from helix-toolkit.
It loads automatically.
from helix-toolkit.
Nice
Thank you i will try how to make it work
from helix-toolkit.
Related Issues (20)
- PBR Material HOT 3
- Applications using Helix-Toolkit.Wpf.SharpDX don't shut down properly HOT 1
- use PostEffectMeshBorderHighlight zoom delay HOT 10
- Viewport Craches when using release build [Wpf/sharpdx/Net8] HOT 2
- Subtract overlapping parts of two 3D models HOT 3
- Crash when logging off with windows key pressed twice
- HelixViewPort3D model cut by invisible plane; fixes itself when zoomed in HOT 1
- HelixToolkit.Wpf TextVisual3D display wrong size when apply `Angle != 0`
- Getting the transformed geometry from a rotated/translated HelixToolkitScene object HOT 2
- Stripes on HelixViewport3D HOT 1
- Can't clone helix-toolkit HOT 1
- MaterialHelper.CreateImageMaterial missing in Core HOT 1
- Compatibility issues of Helixtoolkit.Wpf with .NET 8 (NU1701), discussion on Long-term Support and Migration Strategy HOT 2
- ply model cannot render
- For .net8.0 HOT 1
- [HelixToolkit.Wpf] leaks memory when create a text by using `RenderTargetBitmap` in `BillboardTextVisual3D`, `TextGroupVisual3D`, `TextVisual3D`, `ParticleSystem` ... HOT 1
- ColorStrip Material updatecolors UI display incorrect but export glb is correct。 HOT 1
- HelixToolkit SharpDX see through material HOT 1
- Problem rotating bones with Wpf.SharpDX HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from helix-toolkit.