For bugs and new features, use the issue tracker located at GitHub.
Also try the chat room!
WeakEventListener not called with .NET 3.5
jpg99 wrote at 2012-07-09 10:24:
Hello,
I have to use .NET 3.5 for my application.That needed some modifications in the 3d toolkit code : first commenting all the code referring to 'manipulation' (screen touch interface, introduced in .NET 4), and then moving the cameraController.InputBindings
initializations in .cs code rather than in xaml, as explained in discussion
http://helixtoolkit.codeplex.com/discussions/273572.
After that, most of the mouse and keyboard interface works for pan, zoom and rotate. But rolling the mouse wheel for zoom with inertia didn't work anymore. After some search in your code, i found that the CameraController.renderingEventListener is never called (in .NET 3.5), thus failing to call OnCompositionTargetRendering and finally OnTimeStep, which implements zoom with inertia.
I fixed that problem by replacing the WeakEventLlistener with standard handlers attached to events : for example in CameraController.cs :
private void SubscribeEvents() { this.MouseWheel += this.OnMouseWheel; this.KeyDown += this.OnKeyDown; //RenderingEventManager.AddListener(this.renderingEventListener); CompositionTarget.Rendering += new EventHandler(OnCompositionTargetRendering); } private void UnSubscribeEvents() { this.MouseWheel -= this.OnMouseWheel; this.KeyDown -= this.OnKeyDown; // RenderingEventManager.RemoveListener(this.renderingEventListener); CompositionTarget.Rendering -= new EventHandler(OnCompositionTargetRendering); }
So it works. But using standard event handlers rather than weak events could cause in some cases memory leaks, did i learn by searching a bit about weak events (http://msdn.microsoft.com/en-us/library/aa970850.aspx).
Finally my question is : have you a clue about the reason why the renderingEventListener is not called in .NET 3.5 ?
Thanks for your work.
Using DataTemplate
lucasmckenna wrote at 2012-07-03 10:02:
Hi,
I was wondering if there was a workaround to use Helix Visual3D objects in XAML DataTemplates ?
Thanks.
Great Toolkit BTW.
RobPerkins wrote at 2012-07-05 09:24:
If you encased it in a UserControl, would that be a workable approach?
objo wrote at 2012-07-07 00:57:
I found this blog post
http://pelebyte.net/blog/2009/09/22/more-2d3d-tricks-itemscontrol3d/
It would also be interesting to see an ItemsControl3D derived from a ModelVisual3D that supports data templates. I'm not sure how to implement this, though...
How to hide the pole in the Cloth example
koawangjun wrote at 2012-06-28 08:55:
I am trying to comprehend the Physics involved in Cloth example. After viewing through the code. Unfortunately, could not locate where is the model of pole created. Can anyone enlighten me? because I am trying to display the pure flag instead of flag with pole.
koawangjun wrote at 2012-06-28 09:05:
Oh. I have found the solution, the code for pole is declared in the MainWindow's xaml file.
Track camera rotation
ejleigh wrote at 2012-05-31 16:17:
This is a great project! Many thanks.
I have 3D labels that sit above the scene models. I want the labels to rotate when the camera is rotated so the labels always face the camera. This should occur as the rotation is taking place - not just at the end. Is there an easy way to accomplish this?
objo wrote at 2012-05-31 21:04:
See the "Billboard" and "Overlay" examples in the "Example browser". The billboard text has an issue when spinning the camera (this is not a problem with billboard images) - have not figured that one out yet. The "Overlay" example uses TextBlock elements over the 3D viewport - in some cases this can be the best way to show labels.
ejleigh wrote at 2012-06-12 02:30:
Thanks! This worked well. There is one unexpected behavior that I saw that may be obvious to many but not to a novice like myself. It seems that the backgound material of the billboard cannot be set and it uses the material of most distant object in the Z plane. In many cases, when using this control as a label and not necessarily as a billboard you would want the text to show up with a transparent background. Adding this line to the example xaml after all the TextBillboardVisual3D objects are created will illustrate the problem. <ht:BoxVisual3D Fill="Chocolate" Center="0,0,0" Length="20" Width="10" Height ="20"/> As you rotate the labels overtop of the box the white background of the view shows through. The only way I found to control this so the labels appear to have a transparent background is to ensure the labels are always added to the end of the visual tree. Perhaps there is a better way?
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.
Customer support service by UserEcho