For bugs and new features, use the issue tracker located at GitHub.
Also try the chat room!
Building an ActiveX control from Helix
davepylatuk wrote at 2012-05-10 18:11:
Hello all,
This toolkit looks amazing, takes much of the grunt work out of building 3D wpf graphics. I am wondering how large a task it would be to build an ActiveX control using this toolkit? I have a requirement to build a control that can draw:
- 3D Cylinders and cones (with different textures)
- Rectangular 'pipes' (tubing)
- Text to annotate objects in the 3D space
- Lines and polylines
- Apply different colors and lighting to the scene
- Rotate, zoom, pan, print and export the 3D view
I am very new to Visual Studio... Thanks.
objo wrote at 2012-05-10 21:36:
see http://stackoverflow.com/questions/4134833/how-to-use-winforms-wpf-as-activex-control
Sorry, I don't know more about using WPF in COM/ActiveX.
Helix Solution not working.
Rogad wrote at 2014-05-30 17:16:
I hadn't updated my Helix for while, so I started fresh with TortoiseHg - I followed the instructions here :
https://helixtoolkit.codeplex.com/wikipage?title=Obtain%20and%20build%20the%20code&referringTitle=Documentation
But when I try to open HelixToolkit.Wpf.sln it throws this error :
UnsupportedIn the following migration report I get this :
This version of Visual Studio is unable to open the following projects. The project types may not be installed or this version of Visual Studio may not support them.
For more information on enabling these project types or otherwise migrating your assets, please see the details in the "Migration Report" displayed after clicking OK
HelixToolkit, "C:\Users\Roger\Documents\Visual Studio 2013\Projects\HELIX\Source\HelixToolkit\HelixToolkit.csproj"
HelixToolkit\HelixToolkit.csproj: The application which this project type is based on was not found. Please try this link for further information: http://go.microsoft.com/fwlink/?LinkID=299083&projecttype=786C830F-07A1-408B-BD7F-6EE04809D6DBThe rest of the files appear to be migrated okay as they all have ticks.
Now I cannot work on my project sadly. Could someone please help ?
Many thanks,
Rog.
Rogad wrote at 2014-05-30 17:19:
Rogad wrote at 2014-06-05 19:22:
objo wrote at 2014-06-25 10:00:
HelixToolkit.csproj
project is a portable class library. I think you have two options:
- You can change this to a class library to compile with VS Express.
- You can also remove the project and references in the solution, the project is not yet in use. This option will not work when code is added to that project
TubeVisual3D and Diameters
Lekarsenten wrote at 2013-02-16 20:25:
At first, I want to say "thank you", Your project is something awesome.
I didn't dive deep into Your code yet, but i have a question. As I can see, TubeVisual3D is an element for making curve tubes with variable diameters throug path - so, what i'm doing wrong?:
TubeVisual3D t = new TubeVisual3D();
t.Fill = System.Windows.Media.Brushes.Black;
Point3DCollection p3dc = new Point3DCollection();
List<double> diamlist = new List<double>();
double dx = 15;
double dy = 15;
double dz = 15;
double dd = 10;
int n = 30;
for (int i = 1; i < n; i++)
{
p3dc.Add(new Point3D(0 + Math.Pow((double)i / n, 3) * dx, 0 + ((double)i / n) * dy, 0 + ((double)i / n) * dz));
diamlist.Add(3.5 + ((double)i / n) * dd);
}
t.Path = p3dc;
t.Diameters = diamlist;
_HelixViewport3D.Children.Add(t);
and i'm got curve pipe with constant diameter of 1. Best regards.
p.s. sorry for my bad english, it isn't my native language)
objo wrote at 2013-02-16 22:18:
t.Diameters = diamlist;
t.Path = p3dc;
If you set the diameters last, the mesh will be generated twice. I will correct the bug.
lekarsenten wrote at 2013-02-17 07:15:
Disposing of Helix Viewport and contents
Rogad wrote at 2014-03-01 21:17:
My problem is this....I have two windows. One does operations on files and the second window shows the model in the viewport.
Even when I close the second window with the viewport, the system still has a connection with the files previously used by the viewport.
So when I return to window one I get an error that my files are already being used (by window two).
I thought using Close() on window two would clear things, but it does not.
Drag & Drop ModelVisual3D
davidop wrote at 2013-05-31 08:50:
objo wrote at 2013-06-08 07:53:
I think this should be handled by the application, not by the Manipulator classes.
Using a diameter list halves diameter?
SeanV12 wrote at 2013-06-18 16:45:
As the title said, using a diameter list for a TubeVisual3D instead of one set diameter seems to half the diameter at every point.
I've edited streamlines to see if the problem is here, and it doesn't seem so, setting the tube diameters to one, and the cone radius to .5 produced similar diameters, so I would guess the MeshBuilder tubes are fine, but this:
private void DiamListTube_Click(object sender, RoutedEventArgs e)
{
TubeVisual3D diamListTube = new TubeVisual3D();
Point3DCollection tubePath = new Point3DCollection();
tubePath.Add(new Point3D(0, 0, 5));
tubePath.Add(new Point3D(32, 0, 5));
IList<double> diameterList = new List<double>();
diameterList.Add(10.0);
diameterList.Add(10.0);
diamListTube.Diameters = diameterList;
diamListTube.Path = tubePath;
diamListTube.Fill = Brushes.Red;
MainViewPort.Children.Add(diamListTube);
}
private void NoDiamList_Click(object sender, RoutedEventArgs e)
{
TubeVisual3D tube = new TubeVisual3D();
Point3DCollection tubePath = new Point3DCollection();
tubePath.Add(new Point3D(0, 10, 5));
tubePath.Add(new Point3D(32, 10, 5));
tube.Diameter = 10.0;
tube.Path = tubePath;
tube.Fill = Brushes.Blue;
MainViewPort.Children.Add(tube);
}
Produces this: Am I doing something wrong, or is the Diameter list the issue?
objo wrote at 2013-06-18 22:11:
objo wrote at 2013-06-19 21:32:
I also changed the type of the
Diameters
property, so we can test by the following xaml:<HelixToolkit:TubeVisual3D Path="0 0 5,32 0 5" Diameters="10,10" Fill="Red"/> <HelixToolkit:TubeVisual3D Path="0 10 5,32 10 5" Diameter="10" Fill="Blue"/>
Extrude Polyline
CesarMayorine wrote at 2013-10-08 10:34:
Anyone have an example?
ErOt79 wrote at 2013-10-17 12:55:
CesarMayorine wrote at 2013-10-25 22:21:
Please i need an example in C # or VB, with a curve would be great
rinaldin wrote at 2013-10-28 18:19:
' the Path is a Point3DCollection and the Section is a PointCollection
Dim sect As New PointCollection
' rettangolare
sect.Add(New Point(-1, -1))
sect.Add(New Point(0, -1))
sect.Add(New Point(1, 1))
sect.Add(New Point(-1, 1))
Dim asse As New Vector3D(1, 0, 0)
Dim rend As New ExtrudedVisual3D
rend.Section = sect
rend.Path.Add(pt)
rend.Path.Add(pt1)
rend.SectionXAxis = asse
rend.Fill = Brushes.Green
rend.IsPathClosed = True
rend.IsSectionClosed = True
HelixViewport3D1.Children.Add(rend)
container.Children.Add(rend)
CesarMayorine wrote at 2013-10-30 08:51:
is great, I have a problem with rend.SectionXAxis = asse, you can help me?.
rinaldin wrote at 2013-10-30 14:22:
CesarMayorine wrote at 2013-10-30 16:51:
rinaldin wrote at 2013-10-30 19:41:
shadows for obects
ChevyCP wrote at 2012-01-05 20:45:
Hi,
Is there an easy way to add a shadow for all objects within a helixviewport3d? I added a dropshadow effect, which is what I'm going for, but that doesn't change when I rotate the objects inside relative to the light source. (So that it would grow and shrink depending on where the objects were in the scene.) I understand that this could be a costly function, but was looking for a solution. If this doesn't exist, then I'd like to add it as a feature request.
Thanks!! Great work!
objo wrote at 2012-01-05 21:41:
I don't think it is possible to create shadows as in opengl/directx (using shaders or stencil buffers) with wpf, if this is important I think you should choose another platform than wpf3d... (xna?)
- http://en.wikipedia.org/wiki/Shadow_mapping
- http://www.opengl.org/resources/features/StencilTalk/
- http://www.opengl.org/resources/code/samples/mjktips/rts/index.html
- http://www.riemers.net/eng/Tutorials/DirectX/Csharp/Series3/Shadow_mapping.php
- http://www.gamedev.net/page/resources/_/technical/graphics-programming-and-theory/an-example-of-shadow-rendering-in-direct3d-9-r2019
- http://http.developer.nvidia.com/GPUGems/gpugems_ch12.html
- and many more...
ChevyCP wrote at 2012-01-05 21:47:
Thanks for the fast reply and useful info!! This isn't critical, I was just looking for some eye candy for a program I'm writing. It's for work and instead of using pop-ups it uses sides of a 3d cube using a helixviewport3d with 6 viewport2dvisual3d's. I was just looking for an easy way to add some cool shadows for use during the animations when rotating from side to side.
Thanks!!
Missing wiki page: Create a 3D view
hasanabb wrote at 2013-12-29 10:41:
The documentation on the following page seems to be missing:
http://helixtoolkit.codeplex.com/wikipage?title=Create a 3D view&referringTitle=Documentation
I found the link on this page:
http://helixtoolkit.codeplex.com/documentation
Can you look into fixing this page?
Thank you.
objo wrote at 2014-01-07 22:53:
Currently, the best way to learn this library is to look at the code for the examples.
Start with Source\Examples\SimpleDemo
Model up direction on sphere surface
Cowhide wrote at 2014-01-16 22:04:
Vector3D normal = (placementPosition - centerOfSphere).Normalize
So lets say I have a Point3D for the position of the object. I then translate transform the objects position to put it at this point which works. Next is to rotate it somehow to that it is pointing "up". This is the part I'm missing. Please be gentle, just learning 3D programming.
Thanks!
objo wrote at 2014-01-23 20:07:
Then use the Vector3D.CrossProduct to find a vector that is perpendicular to the two others. Normalize the vectors and now you have an orthonormal basis.
Define a Matrix3D where m11-m33 are the components of the three vectors (defined in rows or columns, I never remember...) and finally create a MatrixTransform3D.
This would be a nice example to add to the example browser - e.g. a sphere with the earth texture and the eiffel tower model - they are already in there!
Customer support service by UserEcho