This is the discussion forum for Helix Toolkit.
For bugs and new features, use the issue tracker located at GitHub.
Also try the chat room!
0

Curved Line

Anonymous 11 years ago 0
This discussion was imported from CodePlex

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.

0

Helix and Avalondock

Anonymous 11 years ago 0
This discussion was imported from CodePlex

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.

0

Transparent GeometryModel3D

Anonymous 11 years ago 0
This discussion was imported from CodePlex

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...

0

Nuget Package

Anonymous 11 years ago 0
This discussion was imported from CodePlex

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!

0

performance degrades when adding several worldpoints instances to children

Anonymous 11 years ago 0
This discussion was imported from CodePlex

jaredmeade wrote at 2014-05-07 02:50:

we've successfully implemented a demo project based on the earth examples in the helix 3d toolkit and we are creating an effect where the world rotates by using a timer and AddRotateForce on the camera controller. The problem we are having is that when more than a couple hundred worldpoints added to the HelixViewport3D children collection, the rotation effect slows down to the point of not being usable.

is there a better way to add additional children the the world sphere without affecting performance dramatically?
0

Problem building mesh for BoxVisual3D

Anonymous 11 years ago 0
This discussion was imported from CodePlex

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.

0

Select a vertex

Anonymous 11 years ago 0
This discussion was imported from CodePlex

everytimer wrote at 2013-11-11 07:56:

I have imported a .stl geometry into Helix and I wonder if it is possible to select a point, a vertex or a surface in order to obtain the coordinates of that element. Thank you very much.

objo wrote at 2013-11-11 12:41:

Try vanilla 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
0

Camera rotates unmeant around z axis for 180 degrees.

Anonymous 11 years ago 0
This discussion was imported from CodePlex

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));
           
        }

0

Transforming a ModelVisual3D vs transforming a GeometryModel3D

Anonymous 11 years ago updated by ไอยดา สุรีวงค์ 4 years ago 1
This discussion was imported from CodePlex

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 

0
Under review

manipulator disable/enable

jason-he 10 years ago updated by Øystein Bjørke 10 years ago 1
Helix toolkit looks so great, I am trying to use it for my work assignment.

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