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

Drag & Drop ModelVisual3D

Anonymous 11 years ago 0
This discussion was imported from CodePlex

davidop wrote at 2013-05-31 08:50:

Hi!. Congratulations for this great library. I am using Helix + Petzold ModelVisual3D drag and drop within a 3D scene. I wonder if it would be possible with Helix similiar effect to which the application is made in Rhinoceros. How they get that dragging a ModelVisual3D with the mouse remains static back home in his position?

objo wrote at 2013-06-08 07:53:

You should create a copy of the visual while performing the manipulation. I think you can add the copy to your scene when the manipulators mouse down event is raised and remove it on mouse up.
I think this should be handled by the application, not by the Manipulator classes.
0

Using a diameter list halves diameter?

Anonymous 11 years ago 0
This discussion was imported from CodePlex

SeanV12 wrote at 2013-06-18 16:45:

Sorry to do two threads back to back, but I've run into another problem.
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:

thanks, this is a bug in the library! I added issue https://helixtoolkit.codeplex.com/workitem/9988

objo wrote at 2013-06-19 21:32:

I have corrected the bug in the TubeVisual3D class.
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"/>
0

Extrude Polyline

Anonymous 11 years ago 0
This discussion was imported from CodePlex

CesarMayorine wrote at 2013-10-08 10:34:

how I can extrude a polyline?
Anyone have an example?

ErOt79 wrote at 2013-10-17 12:55:

Please, i need the same help. I tried AddExtrudedGeometry but didnt understand well the use of it. A simple sample of extruded polygon geometry could be very helpful. Thanks!!

rinaldin wrote at 2013-10-25 15:48:

See here I hope it helps.

CesarMayorine wrote at 2013-10-25 22:21:

thank you rinaldin, exactly what I need.
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:

Thanks you,
is great, I have a problem with rend.SectionXAxis = asse, you can help me?.

rinaldin wrote at 2013-10-30 14:22:

"asse" is a vector orthogonal to the extrusion axis. You have to orient it to the desired direction , but always othogonal to the vector connecting pt and pt1 (starting and ending points of the extrusion).

CesarMayorine wrote at 2013-10-30 16:51:

Is posibel added caps to the extrusion?

rinaldin wrote at 2013-10-30 19:41:

I didn't try yet, but I think so; add a Polygon using the sect points.
0

shadows for obects

Anonymous 11 years ago updated by Lucas Silva 10 years ago 1
This discussion was imported from CodePlex

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!



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

0

Missing wiki page: Create a 3D view

Anonymous 11 years ago 0
This discussion was imported from CodePlex

hasanabb wrote at 2013-12-29 10:41:

Hello,

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:

Yes, we should put some effort into the documentation.
Currently, the best way to learn this library is to look at the code for the examples.
Start with Source\Examples\SimpleDemo
0

Model up direction on sphere surface

Anonymous 11 years ago 0
This discussion was imported from CodePlex

Cowhide wrote at 2014-01-16 22:04:

I want to position loaded models (.obj) on the surface of a sphere (like the Earth demo for example) but I want them to stay "up", point towards the normal direction. Problem is I can't seem to find a way to set the normal of a loaded model. From what I gather, the normal can be computed as:

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:

You need to specify one more vector that defines the orientation of the model.
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!
0

Manipulator

Anonymous 11 years ago 0
This discussion was imported from CodePlex

andrey7b wrote at 2012-11-14 11:25:

Hello,

I'm using the Helix Manipulator, how do I take the arrows of this components and generate it at runtime in wpf / vb.net.

Thank you.

0

Weird binding behavior

Anonymous 11 years ago 0
This discussion was imported from CodePlex

AlexNET4 wrote at 2013-03-14 16:48:

Hey guys,

I've got a weird binding behavior in my application.

It's hard to explain so i will try my best by using some pics :-)

I've got an MVVM-based application which contains a shellview (Window) and a subviews (UserControl)

On startup the shellviewmodel creates 2 instances of the subview which were kept in a collection and this one is bound to the Itemsource property of a combobox.

by switching the selection of the combobox the current view of the shellview is changed.


The subview contains the Viewport and a 3D Model.
<HelixViewport3D Grid.Row="1" ZoomExtentsWhenLoaded="True" 
                                   ShowCoordinateSystem="{Binding ElementName=cbxShowDimensions, Path=IsChecked}">
            <SunLight/>
            <ns:Component3D 
                                   Length="2400" 
                                   Width="1800" 
                                   Thickness="25" 
                                   ShowMeasurements="{Binding ElementName=cbxShowDimensions, Path=IsChecked}"/>
            <SunLight/>
</HelixViewport3D>
As you can see the ShowCoordinateSystem-Property of the Viewport and the ShowMeasurements-Property of the 3D-Model are bound to a checkbox

Now the problem:

View one is updating properly




View 2 does not only the coordinate system does.

Missing dimensions :-(



0

any reason why model importer doesnt support resources

Anonymous 11 years ago 0
This discussion was imported from CodePlex

mocaiv wrote at 2014-02-05 14:55:

Why do i have to have physical paths for all my obj and mtl files? i really dont want to deploy dozens of these model files to customers without first emedding them in a library. it appears the code supports physical paths only. After reviewing the code it would appear to be very simple to simply support streams and pulling from assembly resources. has anyone done this already before I add this myself?

objo wrote at 2014-02-05 15:16:

agree, it should be possible to provide a mechanism that loads the attached files from streams!
https://helixtoolkit.codeplex.com/workitem/10026
0

3ds Model'ss UVs Load Wrong

Anonymous 11 years ago 0
This discussion was imported from CodePlex

ZeroSigma wrote at 2013-03-13 18:42:

Hi, I'm trying to load a 3ds model that I exported out of Blender and everything goes fine but the texture looks wrong. Each face should have its own colour.

This is the code I use to load the model and assign the texture:
 _currentModel = ModelImporter.Load("../../Models/planetCube.3ds");
 Model3DGroup modelGroup = (Model3DGroup)_currentModel;

GeometryModel3D model = (GeometryModel3D)modelGroup.Children[0];

var texture = new ImageBrush();
texture.ImageSource = new BitmapImage(new Uri(@"../../Textures/uvTest2.png", UriKind.Relative));
            model.Material = new DiffuseMaterial(texture);
Here are the files:
http://dl.dropbox.com/u/43365724/planetCube.3ds
http://dl.dropbox.com/u/43365724/uvTest2.png

ZeroSigma wrote at 2013-03-16 08:22:

Solved it thanks to this article on stackoverflow: Why does TextureCoordinates work as expected for a Viewport2DVisual3D, but not for a GeometryModel3D?

Just set ViewportUnits on the ImageBrush to Absolute! :)

objo wrote at 2013-03-17 21:50:

I had a quick look at your model files - it seems like there is no texture defined in the .3ds file?
The StudioReader class already sets the ViewportUnits to Absolute, so I don't think any change is necessary in this library.