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

meshbuilder use in SurfacePlotDemo

Anonymous 11 years ago 0
This discussion was imported from CodePlex

lizichao wrote at 2011-07-09 10:44:

How to use meshbuilder in SurfacePlotDemo? I guess there should be a subclass of ParametricSurface3D. But I didnt find it.

Thanks.

 

Best regards!


objo wrote at 2011-07-11 11:58:

hi Lizichao,
I combined both the surface and the axes into the SurfacePlotVisual3D class in the demo. You can define the surface simply by setting the Points property.
This demo is currently not working with other Visual3Ds, but the plan is to move the axis visuals over to the HelixToolkit to make it easier to reuse!

0

VB.net simple program

Anonymous 11 years ago 0
This discussion was imported from CodePlex

rinaldin wrote at 2013-09-25 17:09:

Hi all,
I'm new to the Helix 3D Toolkit, and I just want to use it in VB.net programs. I started a new WPF project, referenced the libraries needed, and added the following code:
Imports System
Imports System.Collections.Generic
Imports System.Windows
Imports System.Windows.Media
Imports System.Windows.Media.Media3D
Imports HelixToolkit.Wpf

Class MainWindow
    Dim visualChild As New ModelVisual3D
    Dim plotmodel As New Model3DGroup

    Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded

        Dim label1 As GeometryModel3D = TextCreator.CreateTextLabelModel3D("test", Brushes.White, True, 32,
                                                           New Point3D(0, 0, 0),
                                                           New Vector3D(1, 0, 0), New Vector3D(0, 1, 0))
        plotmodel.Children.Add(label1)
        visualChild.Content = plotmodel
        HelixViewport3D1.Children.Add(visualChild)

    End Sub

End Class
The XAML code is:
<Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Prova" Height="378" Width="605" xmlns:h="http://helixtoolkit.codeplex.com" WindowStartupLocation="CenterScreen">
    <Grid>
        <h:HelixViewport3D HorizontalAlignment="Stretch" Name="HelixViewport3D1" VerticalAlignment="Stretch" Background="Black" Margin="0" TextBrush="White" CoordinateSystemLabelForeground="White" InfoForeground="White" />
    </Grid>
</Window>
I get no error messages, but I expect to see in the viewport the string "text", but nothing happens! Can you help me please? I think this thread would be very important for who wants to start developing with Helix in VB.net.

Thank you,
Giovanni

rinaldin wrote at 2013-09-25 21:30:

SOLVED

I think there's a bug in the Helix code, because the code I posted worked fine, exept for the TextColor property in the line:
Dim label1 As GeometryModel3D = TextCreator.CreateTextLabelModel3D("test", Brushes.White, True, 32,
The value Brushes.White has no effect!!! The text is still rendered in black. I try to modify also the HelixViewport3D1.TextBrush property, but still no changes!

I'm opening a new issue on this site.

Giovanni

objo wrote at 2013-09-25 23:16:

Did you remember to add light(s) to your scene?

rinaldin wrote at 2013-09-26 10:46:

Thank you, solved. I added the line:
plotmodel.Children.Add(New AmbientLight(Colors.White))
and all text has the proper color.
0

3dxml?

Anonymous 11 years ago 0
This discussion was imported from CodePlex

Provagino wrote at 2011-10-06 21:16:

Can i import files in 3DXML?


objo wrote at 2011-10-06 22:29:

http://en.wikipedia.org/wiki/3DXML ?

No, 3DXML is not implemented.

0

holes in the box

Anonymous 11 years ago 0
This discussion was imported from CodePlex

DongMini wrote at 2012-08-02 02:07:

Hi, First, great toolkit, thank you! 

 

holes in the box, what should I do?


objo wrote at 2012-08-09 00:48:

The best solution would be to create a MeshGeometry where the holes are modelled. It should not be difficult to do the tessellation if the holes have regular shape.

I would not recommend using textures with transparency to show 'holes' with wpf 3d...


DongMini wrote at 2012-08-09 02:46:

 

var point3d_Out = new[] {new Point3D(0, 0, 0), new Point3D(6, 0, 0), new Point3D(4, 3, 0), new Point3D(6, 7, 0), new Point3D(0, 7, 0)};

var point3d_Hole = new[] {new Point3D(1, 2, 0), new Point3D(3, 2, 0), new Point3D(2, 4, 0), new Point3D(3, 5, 0), new Point3D(1, 5, 0)};

 

 

 

The hole was created by using CuttingEarsTriangulator.Triangulate to you Is there any plan to support.


objo wrote at 2012-08-09 08:48:

I don't think the ear clipping method supports holes (http://en.wikipedia.org/wiki/Polygon_triangulation).

I have not planned to implement other triangulation methods, but maybe you can use code from other .net libraries?


DongMini wrote at 2012-08-10 02:23:

 

Other ". NET libraries" could not be found

hard to sell in the hole  wpf3d


I can not speak English well.
So, more brutal.
google translator, I can not thank you enough  

 

^^;; Hahaha


Thank you so much for letting me answer


0

How to create a circle in 3D with known center point and it is on a plane which perpendicular to a line?

Anonymous 11 years ago 0
This discussion was imported from CodePlex

chinh_nguyen wrote at 2013-01-07 13:15:

Hi all, I am newbie in term of 3D programming with WPF, so please bear with my beginner question: how to create a circle in 3D with known center point and it is on a plane which perpendicular to a line?


chinh_nguyen wrote at 2013-01-09 10:15:

Found the answer when asking in stackoverflow, post here in case anyone interested:

http://stackoverflow.com/questions/14195196/how-to-create-a-circle-in-3d-with-known-center-point-radius-and-it-is-on-a-plan

0

Getting started guide

Anonymous 11 years ago 0
This discussion was imported from CodePlex

lightxx wrote at 2012-11-29 07:28:

Hi guys!

I just stared using helix and WOW is this toolkit powerful. Probably a bit too powerful for programmers inexperienced in 3D modeling like me.

Are there any good primers for the Helix 3D Toolkit? A getting started guide, some sort of walk through or whatever? I tried to find something on google but failed.

 

thanks!


objo wrote at 2012-11-30 18:10:

I recommend Charles Petzold's book "3D programming for Windows".

In this library, the examples are probably the best ways to learn how to use it. All classes should also be XML commented, giving you some info through intellisense.


lightxx wrote at 2012-12-01 16:23:

thank you very much!

0

SharpDX -- MeshGeometry3D -- Normals property

Anonymous 11 years ago 0
This discussion was imported from CodePlex

eonxxx wrote at 2014-03-09 15:19:

hi there,

in helixwpf, the Normals property for a MeshGeometry3D are provided as a sequence of String as follows:
 <MeshGeometry3D Normals="0,1,0 0,1,0 0,0.99620003,-0.087200001 0,0.99620003,-0.087200001 1,0,0 1,0,0 1,0,0 1,0,0 0,-1,0 0,-1,0 0,-0.99620003,0.087200001 0,-0.99620003,0.087200001 -1,0,0
-1,0,0 -1,0,0 -1,0,0 0,0.98479998,-0.1736 0,0.98479998,-0.1736 1,0,0>
...for example.
In the SharpDF version of MeshGeometry3D I'll get an error, says TypeConverter isn't able to convert the sequence to Vector3D[].

The MeshGeometry3D is the result of an import of wavefront.obj model into VSBlend.
Someone has any ideas?
0

Adding/Showing Points

Anonymous 11 years ago 0
This discussion was imported from CodePlex

alexalthauser wrote at 2012-02-24 23:15:

Hi,

I'm working on a project where I need to show a series of vertices in 3d. I can't find any tutorials on how to hide/show lines and verts. I was wondering if Helix has anything that might help, or, if anyone knows of any examples that might be useful.


alexalthauser wrote at 2012-02-25 00:32:

Ah, never mind. I figured it out. =]


objo wrote at 2012-03-10 16:04:

Good. See the PointsAndLinesDemo and the latest bug fix.

0

Default Axis Arrows

Anonymous 11 years ago 0
This discussion was imported from CodePlex

RobPerkins wrote at 2012-09-04 23:07:

I'm still trying to sort out how Helix 3D arranges its axes by default. 

A HelixViewport3D can automatically display a coordinate system graphic which tracks with the camera by specifying this properties:

 <h:HelixViewport3D ShowCoordinateSystem="True" >

This displays three arrows, one each of red, green, and blue. 

The question is, which one corresponds to X, which to Y, and which to Z?

The reason for the question is related to the top view, which when clicked on by the view box displays the arrows as red increasing left, green increasing up, and blue increasing towards the camera. If this is an RHS, then the green corresponds to X. If it's an LHS, then it corresponds to Y. 

Thus, the operative other question becomes "how do I get the "top view" to rotate so that the X axis increases to the right of the screen, the Y axis increases to the top, and the Z axis points toward the camera?


objo wrote at 2012-09-04 23:17:

The red arrow has direction (1,0,0)
The green arrow has direction (0,1,0)
The blue arrow has direction (0,0,1) 


RobPerkins wrote at 2012-09-04 23:25:

objo wrote:

The red arrow has direction (1,0,0)
The green arrow has direction (0,1,0)
The blue arrow has direction (0,0,1) 

OK, that makes Helix's coordinate system a left handed system, with the "top U" view displaying X increasing left, Y increasing up, and Z increasing towards the camera, doesn't it? That is, a rotation proceeding from X=1 to Y=1 happens clockwise

Is there a convenient place to transform the coordinates so that you can get an RHS out of Helix, where the top view corresponds to my second question? 


RobPerkins wrote at 2012-09-05 00:49:

OK, I've done some more testing and it doesn't look like a problem with the coordinate system. 

I added this code to my viewport:

Private Sub VP_MouseMove(sender As Object, e As MouseEventArgs) Handles VP.MouseMove
  Dim q = Viewport3DHelper.FindHits(VP.Viewport, e.GetPosition(VP))
  If q.Count > 0 Then
    Coordinates.Text = q(0).Position.FormattedString
  End If
End Sub

 When in the "U" top view, tracking the mouse along my geometries shows X increasing to the right, and Y increasing up. 

However, while the axis display looks points correctly for Y and Z, it indicates X increasing to the left, which is false! The red arrow appears to have direction (-1,0,0), suggesting a transform in that viewport which is not accurate!

There is no problem with the coordinate system of the main viewport; it's RHS the way we discussed in another thread. It's the viewport onto the axis that I think needs attention. 


RobPerkins wrote at 2012-09-05 01:35:

OK, I've uploaded a small sample here:

 

http://db.tt/Y5vGU0hV

 

... to demonstrate what I mean. Position the running viewer in the "U" top view and run the mouse along the cube from left to right, observing the text below. The X coordinate increases to the right, but the red arrow points left! The Y coordinate increases up, with the green arrow pointing up, as it should, and a Front view shows that the blue arrow, indicating Z, points up with the Z coordinates increasing up.

That X coordinate arrow is inverted.  


RobPerkins wrote at 2012-09-05 01:44:

Found it.

In the project, the "Generic.xaml" file defined this XAML:

 

                            <Viewport3D x:Name="PART_CoordinateView" 
                                        Width="{TemplateBinding CoordinateSystemWidth}" Height="{TemplateBinding CoordinateSystemHeight}" Margin="0" 
                                        HorizontalAlignment="{TemplateBinding CoordinateSystemHorizontalPosition}" VerticalAlignment="{TemplateBinding CoordinateSystemVerticalPosition}" 
                                        ClipToBounds="False" Visibility="{TemplateBinding ShowCoordinateSystem, Converter={StaticResource BoolToVisibilityConverter}}">
                                <local:ArrowVisual3D Point2="-10 0 0" Fill="#964B4B" />
                                <local:ArrowVisual3D Point2="0 10 0" Fill="#4B964B" />
                                <local:ArrowVisual3D Point2="0 0 10" Fill="#4B4B96" />
                                <!--
                                <local:PieSliceVisual3D Normal="1,0,0" UpVector="0,0,1" InnerRadius="3" OuterRadius="6"  Fill="#80ff0000"/>
                                <local:PieSliceVisual3D Normal="0,1,0" UpVector="1,0,0" InnerRadius="3" OuterRadius="6"  Fill="#8000ff00"/>
                                <local:PieSliceVisual3D Normal="0,0,1" UpVector="0,1,0" InnerRadius="3" OuterRadius="6"  Fill="#800000ff"/>
-->
                            </Viewport3D>

The problem was in the vector defining Point2 for the X axis arrow:

                                <local:ArrowVisual3D Point2="-10 0 0" Fill="#964B4B" />

Changing the first value from -10 to 10 corrected the incorrect arrow direction. I don't know if this XAML is present in the current release bits of Helix as I found it in mine or if I twiddled it at one point in the past, since I'm using Helix source code in my project. Might be worth a check...

0

Need advice to apply dash style to screenspace visual3D's

Ashit 9 years ago updated by ไอยดา สุรีวงค์ 4 years ago 1

I want to apply dash styles to screenspace visual3D