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

3D Surface Chart Axes

Anonymous 10 years ago 0
This discussion was imported from CodePlex

gizmodomn wrote at 2013-02-04 13:41:

I am using helix toolkit in my WPF application to show 3D surface charts. The one issue I have is that scales for the axes for the chart are not the same. I can get the data to show, but it is not very useful. Is there some type of scaling for these that I am missing, or is this something that needs to be done manually?

objo wrote at 2013-02-07 20:17:

I guess you are doing something similar to the SurfacePlot example?
You could apply a ScaleTransform3D to your Model3D or Visual3D object, but this will also scale labels and lines.
I think I would try to manually scale the positions of the mesh, and not use transforms!

gizmodomn wrote at 2013-02-14 14:43:

Yes, I am using the SurfacePlot as my example that I'm working from.

That's what I was thinking too. I'll give that a try, thanks!
0

Draw a pipe with layers ???

Anonymous 10 years ago 0
This discussion was imported from CodePlex

terry_513 wrote at 2014-01-16 10:43:

Hello friends,
I have to draw a area, that has 5 vertical areas (lets say layers of different color) each of difference length long. I want the total area (sort of surface) to be X wide and Y long. That will be as a background of the area. On that I got to draw an inclined pipe at certain point and angle. 

I am new in 3D world. I want to achieve this using Helix. I refereed tutorial http://kindohm.com/technical/WPF3DTutorial.htm and ExampleBrowser.exe execution. I couldn't get how to get started on my needs. 

Can anyone please help me know how to get started and achieve my goal. Any link for tutorial may also be helpful - as I am beginner in 3D & Helix. Awaiting for your guidance.

Thanks a lot.

objo wrote at 2014-01-26 20:39:

To learn WPF 3D I recommend:
http://www.charlespetzold.com/3d/
http://www.ericsink.com/wpf3d/

To learn HelixToolkit, I recommend getting the source code (clone or download) and play with the examples in the debugger!
0

Material won't load

Anonymous 10 years ago 0
This discussion was imported from CodePlex

gautamonline wrote at 2012-04-26 07:27:

Hi,

I created a project, added reference to the Helixtoolkit.Wpf project, and took a sphere from the EarthDemo. I placed the png file in the folder which contains the bin, obj and properties folder. The application uses Kinect input, so the user can manipulate the sphere using Kinect.

However materials do not show up when I run the application. Below is the code for the sphere. Please let me know what am I missing in using materials on sphere.

<h:HelixViewport3D x:Name="helixViewport3D1"  InfiniteSpin="True" ZoomExtentsWhenLoaded="True">
            <h:DefaultLights />
            <h:SphereVisual3D Radius="1" Material="{h:ImageMaterial TimeZones2008.png}" ThetaDiv="45" PhiDiv="30" Fill="#FF802121" />
        </h:HelixViewport3D>

thanks

Gautam


objo wrote at 2012-04-26 08:16:

I think your Fill property overrides the Material property. Remove the Fill setting. And make sure the png file is included as Content in your project.


gautamonline wrote at 2012-04-26 08:48:

Thanks for the help! The material is loading. File was in the wrong location. Fill settings did not affect the texture. 

One more question: The transparency which has been applied on the cloud.jpg, is not working. I copied the exact code.

I tried replacing jpg with a PNG file, but it didn't work. If the Binding in removed in the XAML, then the texture loads correctly, but without transparency. 

public static readonly DependencyProperty CloudsProperty = DependencyProperty.Register(
            "Clouds", typeof(Material), typeof(MainWindow), new UIPropertyMetadata(null));

this.Clouds = MaterialHelper.CreateImageMaterial("clouds.jpg", 0.5);

public Material Clouds
        {
            get
            {
                return (Material)this.GetValue(CloudsProperty);
            }

            set
            {
                this.SetValue(CloudsProperty, value);
            }
        }


<h:SphereVisual3D Radius="1.05" Material="{Binding Clouds}" ThetaDiv="90" PhiDiv="45"/>

0

Load 3d objects

Anonymous 10 years ago 0
This discussion was imported from CodePlex

baucez wrote at 2011-09-18 11:08:

Hi,

I am developing an app in which I have to load many 3d object (some of them are big).
Initially I tryed to include them as xaml in the resources but I reach the maximum dimension and visual studio cannot compile them, so I extract them in external xamls that I load dynamically when I need them but loading/parsing xaml files is slow.

I had the idea to compile them in BAML and see if they are faster but i read that baml files are not supported by microsoft

So now I ask to you..

Which is the best way to do it? Which is the fastest way (file format) to read an external 3d object?

 

Thanks,
Roberto.


objo wrote at 2011-09-18 13:52:

hi Roberto! I have not tested the performance on model loading of large files - but I guess the .3ds and .lwo importers (both binary files formats) in Helix toolkit are faster than xaml, baml, stl and .obj importers. Can you try to convert to .3ds or .lwo and compare? It would be interesting to know the result!


baucez wrote at 2011-09-18 16:48:

Actually i never use tools for 3d drawing so I don't know how to convert from autocad 2010/DXF/XAML to 3DS/LWO
I will try to convert files to those fomat and if I'll have success I'll give you feedback about performances.

Of course suggestion on how to convert my models to 3ds or lwo are welcome!! :)


baucez wrote at 2011-12-04 09:58:

It seems to be much more faster with 3ds, however I cannot have the same quality as the xaml version because of the conversoin tools.


objo wrote at 2011-12-04 10:40:

for conversion, try http://meshlab.sourceforge.net/ (open source) or http://www.okino.com/conv/filefrmt_3dexport.htm (commercial)

0

Camera Changing Position Events

Anonymous 10 years ago 0
This discussion was imported from CodePlex

pupunussi wrote at 2012-09-13 15:57:

Hello,

Is there a way to get an event fired every time the viewport starts and ends changing the position of the camera? GotMouseCapture and LostMouseCapture events of CameraController kinda work but not for zooming with mouse wheel.

I have a surface displayed with a high level of detail. What I am trying to do is to decrease the level of detail whenever the user tries to manipulate the camera in order to sustain high enough FPS to keep the program usable.

So far I build two surface with high and low levels of detail and replace one with another and then back on GotMouseCapture and LostMouseCapture events.

I'm pretty sure it's not the best way to achieve the results I need.

Is there a better way to do it?

Thanks!

0

None critical but annoying Bug

Anonymous 10 years ago 0
This discussion was imported from CodePlex

kwcoffee1 wrote at 2014-07-10 00:51:

Hi,

This is a very good 3D toolkit, thank you.

But I noticed the follow flaw:

If the ModelUpDirection property is set to say (0,0,-1) then the viewcube control does not show up in the viewport box.

Again, Thanks,
King

objo wrote at 2014-07-11 21:44:

0

Billboard dynamic size mode?

Anonymous 10 years ago 0
This discussion was imported from CodePlex

robzhu wrote at 2013-07-17 07:07:

First of all, awesome framework. This is all stuff I wish had been included in WPF. Has anyone come up with an easy way to make a billboard scale in size as the camera moves? (i.e. it still always faces the camera, just that it would grow smaller/larger along with the models around it).

objo wrote at 2013-08-08 16:57:

You find the calculation in BillboardGeometryBuilder.GetPositions.
I think you don't need to transform to/from screen space, so this case will be easier.
Use the camera up direction and look direction to find "up" and "right" vectors for the billboard rectangle. Then scale the unit normals by desired width/height in your world space.

PhilDotC wrote at 2014-04-15 08:45:

Robzhu, did you ever get this working as I am struggling with the same task? If so, what is the trick? Or has anyone any additional help they can post.

objo wrote at 2014-04-29 10:28:

We should create an example. I added https://helixtoolkit.codeplex.com/workitem/10040

aueit wrote at 2014-08-15 18:05:

Did someone resolved this problem? PhilDotC, robzhu? I'm trying to do this for weeks, but I can't understand the calculations inside GetPositions.
0

Help Calculating Normals - Sample Code?

Anonymous 10 years ago 0
This discussion was imported from CodePlex

GilbertF wrote at 2012-10-03 22:10:

first thanks for this amaizing tool , i am using mesh builder to create an object made of quads i am passing to the function four points in counter clock  order, this is a laser scanner and i am reading contour to recreated an object, now i have data and an object but it looks bumpy or facet not smooth i need to calculate normals to make it look better,  any help wil be appreciated.

thanks

Gilbert figueroa

orlando, fl


objo wrote at 2012-10-03 22:41:

You don't have to calculate normals, just share vertices for adjacent panels where you want a smooth surface. You will not share vertices when you use the AddQuad method, try to use AddRectangularMesh (if your surface is a 'rectangular mesh') or set the positions and triangle indices yourself!


GilbertF wrote at 2012-10-13 07:49:

Hi Objo

thanks for your last replay i still stock trying to get  a smooth surface im trying to use the addrectangularmesh but no results i was wondering where i can find sample code of the type of data i need to pass to the method it saids it is IList<Point3D>? sample code or sample will be appreciated.

 

thanks

gilbert


objo wrote at 2012-10-14 15:54:

Use "Find usages" function (Shift-F12?) in Visual Studio to find two examples of AddRectangularMesh. The points should be specified 'row by row' and you have to specify the number of 'columns'. Note that the front side of the geometry is defined by the order of the points (reversing the order should reverse the normals).


GilbertF wrote at 2012-10-14 22:54:

Hi Objo and thanks for the replay
Let me add a little more information about what I'm trying to accomplish with the HelixToolkit.

I'm building an application that needs to detect the contour or shape of a hand or foot. This application uses a laser to draw a line on a surface, a hand in this case. We move the laser to a position, then take a snapshot with a camara, analyze the image to detect the X,Y coordinates of the detected red laser line. Then we command the laser to advance a certain distance to a new 'row' (Y coordinate).

What we end up with is a List of rows, technically a List<List<Point3D>>. Our image might be 380 cols by 480 rows. But this list does not contains all the 380x480 points, it just contains the X,Y,Z coordinates of the 'red' laser pixels it detected. As we are advancing the laser 5 or 10 rows at a time we most rows are missing in this collection. Also there can be undetected pixels in each of the rows. So what we have is not a complete collection of X,Y coordinates. And each row might be a different size, etc.

In order to display a more realistic image of the scanned object I'm trying to take this collection of points and plot a smooth surface that interpolates all the missing points from the pixel points we collected from the images.

Below is an excerpt of the different approaches I have taken so far.

First I create the meshBuilder:
MeshBuilder meshBuilder = new MeshBuilder(true, false);

Then we create our points collection and fill it with the data vaules:
List<List<Point3D>> pointsList = new List<List<Point3D>>();
[some code here to fill in the collection]

A- This approach plots a series of small cubes that resemble our scaned hand:
foreach (List<Point3D> pointsRow in pointsList)
foreach (Point3D point in pointsRow)
meshBuilder.AddBox(point, 1, 1, 1);

So that indicates that our points collection is not that far off.

So I'm trying to create a mesh with this points collection by doing this:

Approach #1: (where matrix.maxCols is the width of our image)
meshBuilder.CreateNormals = true;
foreach (List<Point3D> pointsRow in pointsList) {
meshBuilder.AddRectangularMesh(pointsRow, matrix.maxCols);
}

Approach #2: (this will feed a maxCols x maxRows points array with the undertemined values = (0,0,0)
Point3D[,] pointsArray = new Point3D[matrix.maxCols, matrix.maxRows];
foreach (List<Point3D> pointsRow in pointsList)
foreach (Point3D point in pointsRow)
pointsArray[(int)point.X, (int)point.Y] = point;
meshBuilder.AddRectangularMesh(pointsArray);

None of these 2 approaches seems to be working for me and I can't figure out what I'm doing wrong here.
I think it complains about not having the correct number of Normals.
I have also tried to find some examples that uses AddRectangularMesh but no luck so far.
 
Any examples or help in this regard will be greatly appreciated as I'm in an URGENT need to move past this stumble block in order to complete this application.

Thanks in advance!
0

how to read triangle indices from imported model

Anonymous 10 years ago 0
This discussion was imported from CodePlex

jasna100 wrote at 2014-05-20 14:34:

I imported 3d model with helix toolkid. The model is from kinect sensor. The 3d model have parts that are not connected . The object that I scan with the sensor and parts of other objects and the background. How can I read the points and the triangle indices so I can check if they are connected to each other and then create new model just for the object I like.

Any ideas and suggestions?

thanks
0

Beginners Question

Anonymous 10 years ago updated by anonymous 4 years ago 3
This discussion was imported from CodePlex

Patpop01 wrote at 2014-03-22 08:41:

Hi all,

I just downloaded and was trying my first program.

But I have some issues...

I have written following code
<Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:helix="http://helixtoolkit.codeplex.com"
    Title="Prova" Height="378" Width="605" 
    WindowStartupLocation="CenterScreen">
    <Grid>
        <helix:HelixView3D IsViewportHitTestVisible="True">
            <helix:HelixView3D.Camera>
                <PerspectiveCamera LookDirection="-10,-10,-10" Position="10,10,10" UpDirection="0,0,1"/>
            </helix:HelixView3D.Camera>
        </helix:HelixView3D>
    </Grid>
</Window>
But I am always getting errors stating :

__The name "HelixView3D" does not exist in the namespace "http://helixtoolkit.codeplex.com".__
__The tag 'HelixView3D' does not exist in XML namespace 'http://helixtoolkit.codeplex.com'.__
The type 'helix:HelixView3D' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
The attachable property 'Camera' was not found in type 'HelixView3D'.

In the project props I added a reference to HelixToolkit and alle HelixToolkit.wpf items.
I am using VS Express 2012 and have the latest Helix 3D Toolkit.

When I use the code of (Wiki Link: [discussion:459092] ) the code builds, but I still get the
__The name "HelixViewport3D" does not exist in the namespace "http://helixtoolkit.codeplex.com".__ error.

Any ideas?

Thx

Mrme wrote at 2014-03-25 10:27:

Hi , use this line instead :
xmlns:helix="clr-namespace:HelixToolkit.Wpf;assembly=HelixToolkit.Wpf"

Patpop01 wrote at 2014-03-26 06:43:

Hi Thanks for the response... But I did already tried that.

However I finally got it working...

First I tried the install the Nuget on VS2012 express... but that didn't work.
I downloaded the source files using the SVN link on the documentation/install page and tried to build, but I always got an error stating the helixtoolkit.csproj was not compatible with my current version.

So Uninstalled the VS2012 and installed the VS2013 express.
Still the same problem when trying to build myself...
But under VS2013 the Nuget worked. Since then I am enjoying this toolkit.

Now my code does not give me any warning or error.
Thx


tdiethe wrote at 2014-05-01 13:06:

FAQ page is empty??

objo wrote at 2014-05-05 14:57:

cache problem? The FAQ page should contain 3 questions.