For bugs and new features, use the issue tracker located at GitHub.
Also try the chat room!

Curved Line
lmat619 wrote at 2012-06-08 20:55:
Hello. I am wondering if there is anything in the toolkit that gives a curved line. Something kind of like a mix between the PieSliceVisual and the LineVisual? Just wondering if it's out there before I start writing code to make one. Thanks!
objo wrote at 2012-06-09 22:18:
there is a CanonicalSplineHelper class that will interpolate a list of points. You can use this with the LinesVisual3D or TubeVisual3D. (note that the Points collection in LinesVisual3D defines line segments, so you need to modify the result from the CanonicalSplineHelper...)
lmat619 wrote at 2012-06-11 17:53:
Thanks so much! That's exactly what I was looking for. I have one last (stupid) question. The result from CanonicalSplineHelper creates dashed lines. Is there any way I can make it a solid line?
edit:
Nevermind, I figured it out. In the Segment function in CanonicalSplineHelper where the points are added, I changed the way it adds the points to:
if (points.Count == 0) points.Add(pt); else { points.Add(pt); points.Add(points.ElementAt(points.Count - 1)); }
This way, a line is made from each point to its preceding point.

Helix and Avalondock
dfridline wrote at 2012-06-11 15:39:
Hello,
I am new to using the Helix Toolkit and have scoured the forum discussions to see if this has been raised before and couldn't find anything on it. My question is whether or not it is possible to use the Helix Toolkit in combination with Avalondock. I'm putting together an application that will have a similar look to Visual Studio with an Explorer Tree and Properties Editor docked on one side and would like a Viewport where the Code Editor is in VS.
Any thoughts or examples would be greatly appreciated.
Thanks,
Dan
objo wrote at 2012-06-11 15:51:
The OxyPlot.WPF.Plot control is a standard WPF custom control, and should work with AvalonDock. I have done some testing with AvalonDock 1.3, but not 2.0 yet.
If there are problems with the OxyPlot control, please report it in the issue tracker.
dfridline wrote at 2012-06-11 16:02:
objo wrote:
The OxyPlot.WPF.Plot control is a standard WPF custom control, and should work with AvalonDock. I have done some testing with AvalonDock 1.3, but not 2.0 yet.
If there are problems with the OxyPlot control, please report it in the issue tracker.
Objo,
Thanks for the suggestion. I didn't know about the OxyPlot project and it may come in handy for some other things I am doing. However and I am sorry if I wasn't clear in my original post but OxyPlot is not what I am looking for in this project. It appears to be a 2D plotting component and I am looking at the Helix Toolkit so I can display and manipulate 3D models in a Viewport contained within an application that uses Avalondock.
If anyone has tried this before, I would appreciate any advice.
Thanks,
Dan
objo wrote at 2012-06-11 17:07:
sorry, I didn't notice I mixed up my projects... :)
The same answer is valid here:
The HelixToolkit.Wpf.HelixViewport3D control is a standard WPF custom control, and should work with AvalonDock. I have done some testing with AvalonDock 1.3, but not 2.0 yet.
If there are problems with the HelixViewport3D control, please report it in the issue tracker.

Transparent GeometryModel3D
finder_sl wrote at 2012-06-12 10:53:
Hello.
In Polyhedron example, I want to get transparent triangles.
I tried this (PanelModelBuilder class):
// Line 59 in PanelModelBuilder.cs var panelsGeometry = tm.ToMesh(); Brush br = new SolidColorBrush(Colors.Red); br.Opacity = 0.5; m.Children.Add(new GeometryModel3D(panelsGeometry, new DiffuseMaterial(br)) { BackMaterial= new DiffuseMaterial(br) });
But it does not work, the faces are opaque.
How can I do that?
objo wrote at 2012-06-15 06:22:
I don't think it will work to set both Material and BackMaterial in the same model when you want transparency. The transparent triangles nearest the camera should be rendered last, and this doesn't happen automatically.
For simple geometries (e.g. sphere, cuboid) you could try to add two models using the same geometry, the first one with the BackMaterial set, the second one with the Material set. This ensures that triangles inside the shape (furthest away from camera) are rendered before outside triangles (near the camera).
For other geometries (e.g. doughnut) I don't know a good solution to render transparency in wpf 3d...

Nuget Package
murray_b wrote at 2012-03-30 08:24:
Hi Objo
I am using the helix NuGet package to keep up to date with the changes to your library.
Can I just make a request that you remove the HelixWindow.xaml from the next package release please.
As it is a bit annoying having to remove it from our projects everytime we update the package.
thanks for the great library
regards
Murray
objo wrote at 2012-04-03 01:17:
I agree on that. Removed the content from the nuget package!

performance degrades when adding several worldpoints instances to children
jaredmeade wrote at 2014-05-07 02:50:
is there a better way to add additional children the the world sphere without affecting performance dramatically?

Problem building mesh for BoxVisual3D
viettp wrote at 2011-12-18 19:27:
Hi,
I'm trying to add edges to a BoxVisual3D by building a new class ShapeBox that inherit BoxVisual3D
In ShapeBox.Tessellate( ), I write like this:
protected override MeshGeometry3D Tessellate() { var mesh = base.Tessellate(); MeshBuilder builder = new MeshBuilder(); List<Point3D> pts = new List<Point3D>(); // some code lines to add points to pts // create an edges array int[] edges = { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 }; builder.AddEdges(pts, new List<int>(edges), 0.04, 5); builder.Append(mesh); //exception comes from this return builder.ToMesh(); }
The problem is mesh.Normal is null (also does the mesh.TextureCoordinates), because builder.AddCubeFace( ) in BoxVisual3D.Tessellate( ) does not construct those fields.
So I think AddCubeFace( ) should construct those fields.
objo wrote at 2011-12-19 09:27:
I will have a look at this later. Check the constructor arguments of the MeshBuilder - you can specify if normals should be generated or not - there might be a bug in the MeshBuilder.AddEdges method. It should not be neccessary to add normals to the mesh.

Select a vertex
everytimer wrote at 2013-11-11 07:56:
objo wrote at 2013-11-11 12:41:
VisualTreeHelper.HitTest
http://msdn.microsoft.com/en-us/library/ms608751(v=vs.110).aspx
or the
Viewport3DHelper.FindHits
extension method in this library. http://www.nudoq.org/#!/Packages/HelixToolkit/HelixToolkit.Wpf/Viewport3DHelper/M/FindHits

Camera rotates unmeant around z axis for 180 degrees.
31337 wrote at 2012-10-18 14:06:
Hi,
I have the following function
private void MoveToDoubleClick(Point3D doubleClickedTarget) { doubleClickedTarget.Z += 10; CameraHelper.AnimateTo(myCamera, doubleClickedTarget, new Vector3D(0, 0, -1), myCamera.UpDirection, 1000);
}
And only in some situationes the camera rotates for 180 degrees around the z axis. How is this possible? Thanks for help in advance.
31337 wrote at 2012-10-22 09:49:
Changed it to
private void animateToTargetPosition(Point3D hitPoint) { #region Code from Helix lib Vector3D newUpDirection = _cam.UpDirection; Vector3D newRightVector = Vector3D.CrossProduct(_cam.LookDirection, _cam.UpDirection); newRightVector.Normalize(); Vector3D modUpDir = Vector3D.CrossProduct(newRightVector, _cam.LookDirection); modUpDir.Normalize(); #endregion double distance = GeoMath.GeoMathUtils.LineDistance3D(_cam.Position, hitPoint); hitPoint.Z += 10; CameraHelper.AnimateTo(_cam, hitPoint, new Vector3D(0, 0, -1), modUpDir, StaticUtils.GetAnimationTime(distance)); }

Transforming a ModelVisual3D vs transforming a GeometryModel3D
Vicente wrote at 2010-08-03 20:00:
I'm working currently on a 3D project and I'm using Helix for the cameras and the viewport (great work :)). I have noticed a strange behavior that I don't understand much regarding the camera, the movement of the camera and the ZoomToFit method.
For the first part of the project I was working with GeometryModel3D objects, creating the geometry by hand (positions, triangle indices,...) and assigning them their transforms. Everything worked right. Now I have refactored the code base and I have started using ModelVisual3D and I assign the transform there instead of transforming the GeometryModel3D. Now the ZoomToFit doesn't catch the object, the camera moves strangely and when that transform is big enough, everything starts doing pretty weird things.
I have looked at Helix samples and the behavior is similar to the one in the Simple Demo, in the Transformed Model tab. So I suppose that is by design, but I don't really understand the difference or what's happening behind the scenes :)
Could you give me an explanation of why are both things giving so different results? Regards!
Vicente
objo wrote at 2010-08-04 09:02:
hi Vicente! It is good to hear you find the toolkit useful! I just added support for transforms in the ZoomToFit method, and an example in the SimpleDemo. Make sure that your viewport control is loaded before calling the ZoomToFit method. It seems to behave correct now :) Also note that you can use mouse double right click to set the camera LookAt point.
objo wrote at 2010-08-05 00:54:
I corrected a bug in the transform calculation. It should work now, also for combinations of transformations :)
Vicente wrote at 2010-08-06 18:52:
Hi objo!
thanks a lot for the changes :) I have been playing more with the transformations and I have hit another weird thing. It seems the camera translation (middle mouse button) depends on the translation of the object, rotation and zoom. For example, if you have a translation in the object of (200, 150, 100), sometimes moving the mouse to the left will move the object to the left, but depending on the zoom, in some other cases it will move the object to the right, as if the axis got inverted. It's easy to see in the Zoom to Fit tab in the Simple Demo. Also, if the translations are bigger, the camera starts behaving very strangely, and double clicking with the middle mouse button doesn't seem to work correctly.
It looks like a bug to me, but not sure, if you need more information on how to reproduce it let me know. Regards!
Vicente
Vicente wrote at 2010-08-07 03:18:
By the way, I have found also another strange camera behavior. If you try using ZoomToFit with an empty scene, the camera will get "not a number" values in the Position property, and from there it will go crazy, it will never work again. If you try ZoomToFit again after that, it will crash in CameraHelper.cs line 115. If you have an scene with something, then empty it and you try ZoomToFit you get the exception in the same place but related to the newPosition value.
Hope it helps :) Regards!
Vicente
objo wrote at 2010-08-12 09:56:
I corrected the bug when using ZoomToFit on an empty scene. If the bounding box is empty, it will do nothing. I will have a look at the strange camera panning behaviour later (the panning should only depend on the camera position/direction - it uses the Unproject method).Vicente wrote at 2010-08-13 14:30:
Great news :)ReedCopsey wrote at 2010-10-21 03:19:
objo,
Any progress on the strange camera behavior with panning? This has been causing us grief lately.
Thanks,
Reed
objo wrote at 2010-10-21 06:58:
hi Reed,
no, I have not had any progress on that problem. It could be a problem in the Ray3D.PlaneIntersection algorithm... I'll add this to the issue tracker.
I just corrected a similar problem with the zoom - when scrolling very fast you might end up on the 'other side' of the object. The solution there was to clamp the zoom factor.
cheers objo

manipulator disable/enable
Helix toolkit WFP shows some examples. One of them is ManipulatorDemo. Displaying the rotators and translators are useful for a user. But I want some flexibility for a user to disable/enable them, so I added a name to cube1's CombinedManipulator, called Cube1Rotator, also added a double-click event to ht:HelixViewport3D (called ManipulatorViewport3D) to allow a user to toggle CanRotateY, CanRotateX, CanRotateZ. Here is the double-click event,
ManipulatorViewport3D_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
Cube1Rotator.CanRotateX = !Cube1Rotator.CanRotateX;
Cube1Rotator.CanRotateY = !Cube1Rotator.CanRotateY;
Cube1Rotator.CanRotateZ = !Cube1Rotator.CanRotateZ;
}
When I tested it, the rotators were displayed or hidden correctly. However, once double-clicking the mouse, I couldn't rotate or translate the cube1 anymore, even they were displayed.
Any idea?
Thanks in advance
Customer support service by UserEcho