For bugs and new features, use the issue tracker located at GitHub.
Also try the chat room!
Implementing 3D Line Chart over time
sprotznock wrote at 2013-12-02 09:49:
I began WPF 3D programming and I wanted to implement a Line chart which will be updated over time i.e. a kind of waterfall chart in 3D which displayes e.g. spectrums. I had two approaches for this implementation.
First: every spectrum is created as Visual3D with its own Material and GeometryModel3D
Sec: every spectrum is in one big Visual3D
What is the best approach to achieve the solution or is there any better way to do this? Performance is citical as well because it should be filled with live data.
Thanks
objo wrote at 2013-12-02 19:12:
The AudioDemo example in this library shows frequency spectra visualized by scaling boxes in one direction.
sprotznock wrote at 2013-12-03 19:00:
Simple Geometry Lines
Aurega wrote at 2013-11-29 14:51:
I´m just learning with WPF, I want to make simple line by using HelixViewport3D from XYZ coordinations to XYZ, but I can´t figure out which parameters I must use. I tried many combinations but without luck.
Can anyone help me with this ?
RobPerkins wrote at 2013-11-30 08:26:
objo wrote at 2013-12-02 19:59:
I agree with Rob - Petzold's book (and demos) is a great place to start!
Change materials at runtime
Tottel wrote at 2013-11-14 18:04:
I've been using the Helix toolkit for a day now, and I just can't get my head wrapped around it.
I have my own WPF interface, and I can load and display a model into my scene. However, I just can't figure out how to change the materials on the model after loading the model from file.
Does anyone know?
Thanks!
Tottel wrote at 2013-11-19 20:18:
objo wrote at 2013-11-19 22:22:
http://msdn.microsoft.com/en-us/library/system.windows.media.media3d.geometrymodel3d.material(v=vs.110).aspx
Also, make sure the model is not frozen.
Tottel wrote at 2013-11-20 00:11:
I'll give that a try, thanks!
objo wrote at 2013-11-20 08:12:
Tottel wrote at 2013-11-23 14:31:
I think you need to change the material programatically if you load a model into the scene at runtime!And how exactly would I access that material? I use a Model3D after loading in the mesh, but I really don't see where I can change the material anywhere.. :/
a5r wrote at 2013-11-24 10:48:
Tottel wrote at 2013-11-28 10:34:
sync the cameras of different HelixViewport3Ds
lightxx wrote at 2012-12-19 08:49:
I'm designing a UI where i want to exclude a couple of Visual3Ds from hit - testing.
So I thought it would probably be a good idea to use two overlapping HelixViewport3Ds and set IsHitTestVisible to false on one of them to exclude those Visual3Ds from hit-testing.
Now, how do i sync the cameras of those two HelixViewport3Ds so when i pan/zoom/... the first one the second one stays in snyc?
Or is there a better approach to this problem?
lightxx wrote at 2012-12-19 09:14:
ok. the trick was to do two-way bindings. sorry.
<PerspectiveCamera LookDirection="{Binding ElementName=boardView, Path=Camera.LookDirection, Mode=TwoWay}" Position="{Binding ElementName=boardView, Path=Camera.Position, Mode=TwoWay}" UpDirection="{Binding ElementName=boardView, Path=Camera.UpDirection, Mode=TwoWay}"/>
lightxx wrote at 2012-12-19 09:24:
the Viewports still have a slight offset ... weird.
objo wrote at 2012-12-19 09:27:
Did you try using UIElement3Ds
http://msdn.microsoft.com/en-us/library/system.windows.uielement3d.ishittestvisible.aspx
lightxx wrote at 2012-12-19 10:03:
thanks for pointing me in the right direction!!!
Get visible meshes in HelixViewport3D
chriskro wrote at 2013-11-05 16:34:
I wonder if it is possible to get all visible content that is rendered in HelixViewport3D?
Does anybody have experience with that?
Greetings,
Chriskro
objo wrote at 2013-11-11 12:43:
Visual3DHelper.Traverse
method http://www.nudoq.org/#!/Packages/HelixToolkit/HelixToolkit.Wpf/Visual3DHelper/M/Traverse(T)
Select it in the source code and press Shift-F12 and you will find many examples of usage!
chriskro wrote at 2013-11-13 09:01:
As far as I could see it, it traverses over the model elements, even when they are not visible. But the question is, how do I find out, if a specific element is visible?
objo wrote at 2013-11-19 23:03:
See also https://helixtoolkit.codeplex.com/workitem/10003
Load multiple 3ds file in viewport
sarankani wrote at 2012-12-10 20:01:
Hi Objo,
I am new bee to helix 3D. I need to load many .3ds file in helix viewport. Now i am using the following code
var modelGroup = new Model3DGroup();
var reader = new StudioReader();
FileStream c = new FileStream(@"F:\\helixtoolkit3dfiles\" + URL, FileMode.Open, FileAccess.Read, FileShare.Read);
reader.TexturePath = ".";
modelGroup = reader.Read(c);
this.Model = modelGroup;
c.Close();
I can only load one file at a time. I need to load many. Thanks in advance for your help. Please let me know your suggestions.
objo wrote at 2012-12-13 23:02:
try adding the loaded models to the Children collection
http://msdn.microsoft.com/en-us/library/system.windows.media.media3d.model3dgroup.children.aspx
Creating new model after cutting
MichaelKubrak wrote at 2012-09-27 15:14:
Hello. I need to show the distribution of heat in a solid object. The first thing I came up with that figure expanded to many cubes and noticed paint them depending on the situation. but it's no good for me, because shapes are complex and large.The second thought is that the load already created a model from a file, and then divide it by cutting. But after cutting a cavity appears in the model. Please tell me how to close the cavity?Cutting is done using MeshGeometryHelper.Cut function. Maybe you can get all the vertexes models after cutting, and put them together again to paint this area?
objo wrote at 2012-10-09 22:28:
There is a simple "Ear clipping" triangulation method (see Geometry/CuttingEarsTriangulator) that can be used to close simple convex polygon cutting regions. If your cuts are creating more complex regions you need a more advanced triangulation method (not included in this toolkit). http://en.wikipedia.org/wiki/Polygon_triangulation
Printing to scale
murray_b wrote at 2012-03-27 05:28:
Hi objo
I am trying to print out to scale from the HelixViewport3D.
I have an example from the book "3D Programming for Windows by Charles Petzold"
In it he utilises the Viewport3DVisual for printing to be able to control the printing better. ( do you have this book I can post the relevant sections if not). Of course HelixViewport extends Viewport3D so I don't have access to this and am not sure how to get it.
Is this something you think I can use Helix for, and would this be a good approach. Or can you recommend a better way to print to scale.
thanks
Murray
objo wrote at 2012-04-05 01:47:
I have not tried this myself, but I understand you have to create a separate Viewport3DVisual to do this (I see Petzold put it inside a VisualBrush with stretch=None). Have you tried temporarily moving the camera and Visual3D contents from the HelixViewport3D to the Viewport3DVisual when you want to print?
murray_b wrote at 2012-08-31 12:29:
Hi Objo
I have done this and I was thinking it was working fine.
However I have recently found that I can't get text to be printed.
Once I narrow down the issue I will post more. I just wanted to check that you haven't made this work since we had this discussion.
thanks
Murray
murray_b wrote at 2012-09-07 02:28:
For anyone else who has this problem.
We got it working. Basically had to pause the code before creating the image from thh Veiwport3DVisual
visual3D.Dispatcher.BeginInvoke(new System.Action(() => { })).Wait();
BitmapSource bitmapSource = RenderBitmap(visual3D, Width, Height, Brushes.White);
It now renders the text correctly
Point Cloud to Mesh
zaurska wrote at 2012-08-15 16:52:
Hi
Is there a good way to take Point data and generate a mesh?
I have 300,000 points and if I just iterate through taking consecutive triangles and ignoring "Big triangles" I get a sort of usuable point cloud in about 2 seconds but I want a surface.
I don't have a regular grid so some of the examples (Surface Plot and Kinect Demo) are nearly what I need but not quite.
I'm at the limit of my math and want to resist getting into delaunay/voronoi if its already a feature here.
H3D is so great!
Z
objo wrote at 2012-08-24 09:47:
Do you need a convex hull? See http://miconvexhull.codeplex.com/
some bugs found in MeshBuilder
jpg99 wrote at 2012-08-15 15:17:
hello,
i'm using your toolkit for a project at work . I have to draw 3d houses from a 2D polygon (plane section of the house), so i experimented with AddExtrudedGeometry, and encountered several difficulties. Eventually i wrote my own function for building the 3d houses, and i don't remember precisely what the problems were (sorry it was a few weeks ago), mostly problems with triangles defined in the wrong sense so that the outside / inside were inversed.
Here is the code i corrected in MeshBuilder.cs :
public void AddExtrudedGeometry(IList points, Vector3D xaxis, Point3D p0, Point3D p1) { var ydirection = Vector3D.CrossProduct(xaxis, p0 - p1); ydirection.Normalize(); xaxis.Normalize(); int np = 2 * points.Count; foreach (var p in points) { int i0 = this.positions.Count; var v = (xaxis * p.X) + (ydirection * p.Y); this.positions.Add(p0 + v); this.positions.Add(p1 + v); v.Normalize(); if (this.normals != null) { this.normals.Add(v); this.normals.Add(v); } if (this.textureCoordinates != null) { this.textureCoordinates.Add(new Point(0, 0)); this.textureCoordinates.Add(new Point(1, 0)); } int i1 = i0 + 1; int i2 = (i0 + 2) % np; int i3 = i2 + 1; this.triangleIndices.Add(i0); this.triangleIndices.Add(i2); this.triangleIndices.Add(i1); this.triangleIndices.Add(i2); this.triangleIndices.Add(i3); this.triangleIndices.Add(i1); } }public void AddTriangleFan( IList fanPositions, IList fanNormals = null, IList fanTextureCoordinates = null) { if (this.positions == null) { throw new ArgumentNullException("fanPositions"); } if (fanNormals != null && this.normals == null) { throw new ArgumentNullException("fanNormals"); } if (fanTextureCoordinates != null && this.textureCoordinates == null) { throw new ArgumentNullException("fanTextureCoordinates"); } int index0 = this.positions.Count; foreach (var p in fanPositions) { this.positions.Add(p); } if (this.textureCoordinates != null && fanTextureCoordinates != null) { foreach (var tc in fanTextureCoordinates) { this.textureCoordinates.Add(tc); } } if (this.normals != null && fanNormals != null) { foreach (var n in fanNormals) { this.normals.Add(n); } } int indexEnd = this.positions.Count; for (int i = index0; i + 2 < indexEnd; i += 3) { this.triangleIndices.Add(i); this.triangleIndices.Add(i + 1); this.triangleIndices.Add(i + 2); } }
objo wrote at 2012-08-24 09:49:
Thanks for the code! I added http://helixtoolkit.codeplex.com/workitem/9964
Customer support service by UserEcho