Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 01 08:48
    chenhao86 commented #1866
  • Dec 01 08:24
    antithing closed #1865
  • Dec 01 08:24
    antithing commented #1865
  • Nov 30 14:34
    holance commented #1865
  • Nov 30 12:19
    antithing commented #1862
  • Nov 30 11:43
    JamesTingle commented #1862
  • Nov 30 10:20
    antithing commented #1865
  • Nov 30 07:50
    holance commented #1866
  • Nov 30 06:44
    chenhao86 opened #1866
  • Nov 29 19:41
    holance commented #1865
  • Nov 29 19:40
    holance commented #1865
  • Nov 29 19:40
    holance commented #1865
  • Nov 29 17:01
    antithing commented #1865
  • Nov 29 17:00
    antithing commented #1865
  • Nov 29 14:49
    holance commented #1865
  • Nov 29 12:04
    antithing commented #1865
  • Nov 29 11:54
    antithing commented #1865
  • Nov 29 11:54
    antithing commented #1865
  • Nov 29 05:18
    chenhao86 closed #1857
  • Nov 29 05:18
    chenhao86 commented #1857
Mythanon
@Mythanon

So HelixToolkit.SharpDX.Core.Assimp 's Loader will bring in google draco files apparently, but the loader produces a HelixToolkitScene, which has one or many SceneNode's.

HelixToolkit.WPF.SharpDX also has its own SceneNode class. I'm trying to now copy all properties requires from the SharpDX.Core SceneNode to the WPF.SharpDX SceneNode. The only matching property I can find that matters is ModelMatrix, although the WPF.SharpDX SceneNode also requires geometry, otherwise I get a null pointer exception when adding the node to the Viewport3DX.

My current question is, is this really the only way to go about this? Or is there something standardized to import google draco into a WPF environment

Mythanon
@Mythanon

Okay after a ton of reading in this thread all the way back to 2019
I found a comment that mentions a prereleased package : helixtoolkit.sharpdx.core.wpf
You have to use a package manager console to get it
Install-Package HelixToolkit.SharpDX.Core.Wpf -Version 2.12.0

Then you remove HelixToolkit.WPF.SharpDX Package

After that, there is no difference in scenenode. If only this information was publicly accessible

Lunci
@holance
@Mythanon The only differences is the namespace. HelixToolkit.WPF.SharpDX provides a wpf wrapper for HelixToolkit.SharpDx.Core. If you don't need to use wpf binding, you can use scene node directly with HelixToolkit.WPF.SharpDX package.
See FileLoadDemo for details.
HelixToolkit.Wpf.SharpDX.Assimp is a separate nuget package you need to install.
Chris Hill
@robotron2084
i am failing at finding how to turn off the scene gizmo in the lower right corner in a Viewport3DX. Any idea what this thing is called and where I can control it?
Mythanon
@Mythanon

@holance I understand the difference in namespace; but from my testing, importing things like gitF is not possible in the available file reader classes in HelixToolkit.WPF.SharpDX since it doesn't completely wrap assimp (from what I can see).
Where HelixToolkit.SharpDx.Core does completely wrap assimp. So I got my gitF loader working.
Next, since I am using WPF, I had to download HelixToolkit.SharpDx.Core.WPF using the package manager console as the package manager didn't publicly list the package nor is there any documentation about it anywhere I could find.

I suggest adding some documentation regarding the importance of selecting either namespace and the solutions for things like trying to use core.sharpdx with assimp and WPF.

All around I'm finding it hard and losing time to solve issues. Now I have a SceneNodeGroupModel3D which contains all of the scenenodes imported using core.sharpdx.assimp, which allows me to drop nodes into the WPF Viewport3DX, however I am not getting any bounds feedback on the SceneNodeGroupModel3D, I instead of to traverse and use encapsulate methods to add up all of the meshnode geometry bounds.

Unless, is there something I can do to refresh the bounds information for the node tree?

Please don't take my feedback here as negative, I love HelixToolkit so far.
Mythanon
@Mythanon
@holance To simplify my question. Given a SceneNodeGroupModel3D and/or respective SceneNode, is there a way to get the Bounds or Center of the entire SceneNode and all items within?
Mythanon
@Mythanon
My workaround for now
BoundingBox modelBounds = new BoundingBox();
foreach (MeshNode mesh in mouseOverModelController.model.SceneNode.Traverse().Where(x => x is MeshNode).Select(x => (x as MeshNode))) {
modelBounds = BoundingBox.Merge(modelBounds, mesh.Bounds);
}
Lunci
@holance
@Mythanon I believe you are using Dot Net Core version of WPF instead of Dot Net WPF, that's why you need HelixToolkit.SharpDx.Core.WPF instead of HelixToolkit.WPF.SharpDX.
We do not support bounds for groups. You need to calculate the bound yourself.
Chris Hill
@robotron2084
That works @Mythanon . If the performance is too poor, you can use the NodeGroup_OnAddChildNode, NodeGroup_OnRemoveChildNode, and NodeGroup_OnClear to listen for events on the group and maintain a bounding box in a BoundingBoxGroup class. This is how the octree works as well if you need some reference.
Lunci
@holance
@robotron2084 The gizmo is view cube, you can turn it off from Viewport3DX.ShowViewCube = false
Lunci
@holance
@Mythanon For documentation, since this project is maintained by us at spare time, we don't really have bandwidth to update our documentation. Contribution to the documentation is always welcome for anyone.
Chris Hill
@robotron2084
@holance awesome! thank you.
'view cube'...makes sense now that I know it :)
venelin-p-petrov
@venelin-p-petrov
Hi everyone. I am trying to display some transparent meshes using WPF .NET Core and HelixToolkit.SharpDX.Core.WPF, very similar to the OrderIndependantTransparentRendering example. I want to achieve pretty much the same, but instead of using PhongMaterial I want to use VertColorMaterial. Is this possible? If I just change the material and set the IsTransparent property on the MeshGeometryModel3D to FALSE, the transparency works only when looking through the last mesh added in the scene. Which is not order-independent transparency. If I leave the IsTransparent property to TRUE, then the meshes are not rendered at all.
Lunci
@holance
@venelin-p-petrov Currently VertColorMaterial does not support OIT rendering, you can set Viewport3DX.EnableOITRendering = false to workaround the issue.
Chris Hill
@robotron2084
I have a Viewport3DX in a custom UserControl (wpf). This usercontrol is embedded in a window, which is opened and closed. When I close the window, then open another copy of the window, I get the error: Specified element is already the logical child of another element. Disconnect it first.. If I remove the Viewport3DX it doesn't seem to have this issue. Afaict I'm not re-using anything here, but somehow it seems like maybe the Viewport is reusing things internally. Perhaps I'm not correctly disposing things. Any ideas as to what I could be doing wrong?
Mythanon
@Mythanon
@holance Thanks a lot, if I have time I will definitely contribute.
@robotron2084 Thanks Chris, I only need the bounds to get the 3d center point in order to draw an overlay of a line to a box in WPF when mousing over certain model groups. So calculating per mouseover event isn't that computationally expensive. Thanks for offering an additional option using events.
Lunci
@holance
@robotron2084 You cannot share wpf elements with two logical parents. You need to set your window content to null when close the window before reuse any wpf elements for another window.
Chris Hill
@robotron2084
@holance hmm...i see. I'm not sharing these objects on purpose but I shall see if nulling out the contents will help.
well that's interesting. It looks like setting the content to null does work. And it looks like it is recycling my view...somehow. Which is a more wpf-related question I will investigate elsewhere. Thanks for your help!
redrabbit007
@redrabbit007
I'm trying to load a model from a file and then add a model created with a MeshBuilder to the same Group. That way I can transform them together. What am I doing wrong here?
// Load the object.
SceneNode scene = await OpenFile("test_model.obj");

// Create the arrow model.
var arrowModel = new MeshGeometryModel3D();
MeshBuilder mb = new MeshBuilder();
mb.AddArrow(new Vector3(0, 0, 0), new Vector3(0, 0, 1), 0.05);
arrowModel.Geometry = mb.ToMeshGeometry3D();
arrowModel.Material = PhongMaterials.Gray;
arrowModel.Transform = Transform3D.Identity;

// Group them together.
// Is this the right type of "group" to use?
SceneNodeGroupModel3D group = new SceneNodeGroupModel3D();
group.AddNode(scene);
group.AddNode(arrowModel); // This is the line that gives an error - "cannot convert from MeshGeometryModel3D to SceneNode"
Chris Hill
@robotron2084
so i think what you want to do is create a GroupNode and AddChildNode your nodes to that. THEN AddNode that to the SceneNodeGroupModel3D. But I cannot give you a good reason why, as I'm still figuring this out as well. :)
Minsung
@nbright
There was no response on this question https://helixtoolkit.userecho.com/communities/1/topics/439-loading-issue-of-sharpdx-on-xbap. Is it available using HelixToolkit-SharpDx on the web?
Lunci
@holance
@redrabbit007 SceneNodeGroupModel3D only accepts SceneNode type. If you want to add WPF models, you need to use GroupModel3D.
Or change the arrowModel type to MeshNode
@nbright We no longer needs sharpdx_direct3d11_effects_x86.dll in HelixToolkit.SharpDX versions after v2.0 release
thienmenh294
@thienmenh294
In helixtoolkit.sharpdx, can I set rotation's center is model's center?
Lunci
@holance
@thienmenh294 Set Viewport3DX.FixedRotationPointEnabled = true and then set Viewport3DX.FixedRotationPoint to your model center.
Chris Hill
@robotron2084
@holance I have emailed you at the gmail address in the readme, in case you don't check that email very often. :)
John
@heyufei2008
Hi
<ht:BillboardVisual3D Position="6,10,3" Width="100" Height="100" Material="{ht:ImageMaterial roadsign.png, IsEmissive=true}"/>
How to set position of a billboardVisual3D?
what does the position mean?
Chris Hill
@robotron2084
@heyufei2008 A billboard contains a collection of ImageInfo objects, which define the positions of the billboards. The ImageInfo object defines a Position that can be used to define where the billboard should be placed.
thienmenh294
@thienmenh294
Hi
In Sharpdx, Model vibrates when zooming. How to fix it?
Lunci
@holance
@thienmenh294 Could you provide a sample to show the issue?
thienmenh294
@thienmenh294
How to send project
thienmenh294
@thienmenh294

I did ZoomFit
Vector2 center = new Vector2(Convert.ToSingle((xMax + xMin) / 2), Convert.ToSingle((yMax + yMin) / 2));//Center 2D
Vector3 center3D = new Vector3();
DieCreationWindow.ViewPort.UnProjectOnPlane(center, new Vector3(0, 0, 0), DieCreationWindow.ViewPort.Camera.LookDirection.ToVector3(), out center3D);//Find center 3D
DieCreationWindow.ViewPort.ZoomToRectangle(new Rect(new System.Windows.Point(xMin - 5, yMin - 5), new Size(sizeX + 10, sizeY + 10)));
Vector3D lookDirection = DieCreationWindow.ViewPort.Camera.LookDirection;
lookDirection.Normalize();
DieCreationWindow.ViewPort.Camera.LookDirection = lookDirection;
DieCreationWindow.ViewPort.Camera.LookAt(center3D, 0);

after using it then use the zoom to maximize, model vibrates

thienmenh294
@thienmenh294
Can I set PostEffectMeshXRay for GroupModel3D?
thienmenh294
@thienmenh294
How to always see a hidden Model?
Lunci
@holance
@thienmenh294 GroupModel3D doesn't support effect.
Not sure what you mean by show hidden model.
thienmenh294
@thienmenh294
How to always see a obscured Model?
thienmenh294
@thienmenh294
Do you know the cause of my model vibrates when zooming?
Lunci
@holance
@thienmenh294 You can create an issue in github upload a sample there.