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

HelixToolKit 3d How to add shadows?

Zaug 3 years ago 0
I'm building an engine with helix toolkit, but I can't add shadows, I'm new to helix, and I need your help, please.......
0

How can I draw many circles with SharpDX

MichaeInsberg402 3 years ago updated by Kong Lee 2 years ago 206

Hi,

I want to draw many circles on the viewport.

Each circle should have a differnt color.

How can I do that.

I try it with the LineBuilder but then circle has many colors.

foreach (var _ in Lines.LineGeometry.Lines)
{
  var color = GetNewColor(); //Ttis method just return a clolor
  Lines.LineGeometry.Colors.Add(color);
  Lines.LineGeometry.Colors.Add(color);

Any suggestions?

0

How can I zoom in and out in Helix with SharpDX with C#

MichaeInsberg402 3 years ago updated by Kong Lee 2 years ago 205

I try to zoom in and out in the code behind.

<hx:Viewport3DX
            Name="Viewport"
            BackgroundColor="Black"
            Camera="{Binding Camera}"
            EffectsManager="{Binding EffectsManager}"
            ShowViewCube="False">
</hx:Viewport3DX>


public OrthographicCamera Camera { get; }

public void ZoomIn()
{
  var newPosition = new Point3D(Camera.Position.X, Camera.Position.Y, Camera.Position.Z * 1.5);
  Camera.AnimateTo(newPosition, Camera.LookDirection, Camera.UpDirection, 500);
} 

but nothing changed.


The Camera.Position.Z was changed but not the view of hte application.


Any suggestions?

Greeting Michael

0

How to invert Zoom In/Out with MouseWheel ?

mapa 3 years ago 0

Hello,

How can I invert to Zoom In/Out Direction with the MouseWheel?

I want zoom in if I scroll down with the mouse wheel and zoom out if I scroll up with the mousewheel.

How can I solve this?

regards, mx

0

Draw Triangle from "for cycles" iusse

Damien Darhk 3 years ago updated by ไอยดา สุรีวงค์ 3 years ago 1

I need to draw from code behind, (not from xaml), a large number of triangle. For calculation I calc half Triangleindices with a for cycle and the other half with another. Here the code : xaml:

<Window x:Name="MainWindowX" x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:HelixTest"
    xmlns:HelixToolkit="clr-namespace:HelixToolkit.Wpf;assembly=HelixToolkit.Wpf"
   
    mc:Ignorable="d"
    Title="MainWindow" Height="450" Width="800">
<Grid>
    <HelixToolkit:HelixViewport3D Name="myviewport" ZoomExtentsWhenLoaded="True"  Background="Black"  ShowCoordinateSystem="True" >
        <!-- Remember to add light to the scene -->
        <HelixToolkit:SunLight/>
        <ModelVisual3D>
            <ModelVisual3D.Content>
                <GeometryModel3D x:Name="myGeometryModel3D">
                    
                    <GeometryModel3D.Geometry>
                        <MeshGeometry3D x:Name="myMeshGeometry3D">


                        </MeshGeometry3D>
                    </GeometryModel3D.Geometry >
                    <GeometryModel3D.Material>
                        <MaterialGroup>
                            <DiffuseMaterial>
                                <DiffuseMaterial.Brush>
                                    
                                        <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                                            <LinearGradientBrush.GradientStops>
                                                <GradientStop Color="red" Offset="2" />
                                                <GradientStop Color="Red" Offset="3" />
                                                <GradientStop Color="Blue" Offset="4" />
                                                <GradientStop Color="LimeGreen" Offset="5" />
                                            </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </DiffuseMaterial.Brush>
                            </DiffuseMaterial>
                        </MaterialGroup>
                    </GeometryModel3D.Material>
                </GeometryModel3D>
            </ModelVisual3D.Content>
        </ModelVisual3D>

       
     
        <HelixToolkit:BillboardTextVisual3D Position="11 0 0" Text="X" Foreground="Yellow"/>
        <HelixToolkit:BillboardTextVisual3D Position="0 11 0" Text="Y" Foreground="Yellow" />
        <HelixToolkit:BillboardTextVisual3D Position="0 0 11" Text="Z"  Foreground="Yellow"/>
    </HelixToolkit:HelixViewport3D>

</Grid>

and vb.net code behind

Imports System.Windows.Media.Media3D
Imports HelixToolkit

Class MainWindow
    Dim punti = 5
    Dim curve = 5
    Dim valori As New List(Of Integer)
    Dim indices As New List(Of Integer)
    Dim triangoli = (punti - 1) * (curve - 1) * 2

    Private Sub MainWindowX_Loaded(sender As Object, e As RoutedEventArgs) Handles MyBase.Loaded, MyBase.Loaded

        myMeshGeometry3D.Positions.Clear()
        myMeshGeometry3D.TriangleIndices.Clear()

        valori.Add(0)
        valori.Add(1)
        valori.Add(2)
        valori.Add(3)
        valori.Add(3)
        valori.Add(0)
        valori.Add(1)
        valori.Add(2)
        valori.Add(3)
        valori.Add(3)
        valori.Add(0)
        valori.Add(1)
        valori.Add(2)
        valori.Add(3)
        valori.Add(3)
        valori.Add(0)
        valori.Add(1)
        valori.Add(2)
        valori.Add(3)
        valori.Add(3)
        valori.Add(0)
        valori.Add(1)
        valori.Add(2)
        valori.Add(3)
        valori.Add(3)



        'load myMeshGeometry3d.Positions
        For I = 0 To curve - 1
            'per ogni curva
            For b = 0 To punti - 1
                myMeshGeometry3D.Positions.Add(New Point3D(b, I, valori(I * punti + b)))

            Next


        Next

        'First half
        For d = punti + 1 To triangoli - 2 Step punti
            For f = 0 To punti - 2 Step 1
                myMeshGeometry3D.TriangleIndices.Add(d + f)
                myMeshGeometry3D.TriangleIndices.Add((d - 1) + f)
                myMeshGeometry3D.TriangleIndices.Add((d - punti) + f)
            Next
        Next
        'second half
        For j = 0 To triangoli Step punti
            For i = 0 To punti - 2 Step 1
                myMeshGeometry3D.TriangleIndices.Add(j + i)
                myMeshGeometry3D.TriangleIndices.Add((j + 1) + i)
                myMeshGeometry3D.TriangleIndices.Add((j + punti) + i)
            Next
        Next
    End Sub
End Class

My iusse is that only the triagles that are generate from the first cycle are showed, the second not. I tried to swap the cycle and they are both correct. I also tryed to add 2 button, one for cycle. they work to show half triangle, but only it first I clear the triangleindices.What am I missing? Any advice?

0

how to use a xaml file in WPF that does not have an .cs

Echo 3 years ago updated by ไอยดา สุรีวงค์ 3 years ago 1

Image 173

I have a .xaml file from, HelixToolkit how do I use it in Microsoft Visual Studio? Is don't have a .cs. has anyone used this before?

Image 174

And I cannot see it, it will not come up.

how do I use this ?

0

Suggestions and ideas are greatly appreciated

nick 3 years ago 0

Suggestions and ideas are greatly appreciated 1XBET

0

สมัครW88 คาสิโนออนไลน์ ครบวงจร 2021

nick 3 years ago 0

ใครที่กำลังมองหาเว็บออนไลน์หรือยังนึกไม่ออกว่าจะเลือกใช้บริการเว็บไหนดีทางเราขอเสนอเว็บไซด์ W88 เป็นเว็บที่ได้รับการเสริมความงามและน่าสนใจสูงสุดจากเซียนระดับประเทศและยังได้รับความนิยม เร็วที่สุดในเอเชียไม่ว่าจะช่องว่างในรูปแบบทางไหนทางเว็บ W88 ของเรามีให้บริการครบทุกรูปแบบบเพื่อตอบสนองความต้องการของสมาชิกได้ทุกความต้องการคำแนะนำสามารถอ่านบทความด้านล่างได้เลยสมัครสมาชิก ได้ตลอด 24 ชม สมัครW88

0

รีวิวUfaslot เว็บUfaslotที่ดีที่สุด 2021

nick 3 years ago 0

Ufaslot นั้นอย่างที่เป็นที่รู้กันดีอยู่แล้วสำหรับเว็บพนันยูฟ่าเบทของเรานั้น ถือได้ว่าเป็น เว็บUfaslotที่ดีที่สุด และเป็นเว็บพนันออนไลน์ครบวงจรเจ้าใหญ่ที่ดีที่สุดในเอเชียเลยก็ว่าได้เพราะว่าเป็นเว็บพนันแบบใหม่ที่มาในรูปแบบออนไลน์ที่มีคนเข้าใช้บริการร่วมเสี่ยงดวงเดิมพันกับทางเรามากกว่า 1000000 คนอีกทั้งยังคงเป็นเว็บการพนันในรูปแบบออนไลน์ที่ได้รับรางวัลมากมายหลายสาขามาการันตีจากสถาบันเว็บพนันออนไลน์ที่ได้รับมาตราฐานจากอเมริกา รีวิวUfaslot

0

สมัคร138BET และวิธีการเลือกเว็บไซด์ออนไลน์ 2021

nick 3 years ago 0

วิธีการเลือกเว็บไซด์ออนไลน์ในปัจจุบันอย่างที่ทุกคนทราบกันดีว่าการเผยแพร่ออนไลน์นั้นเป็นที่นิยมมากเนื่องจากในสมัยนี้เราสามารถเล่นการพนันผ่านช่องทางออนไลน์ได้โดยเพียงแค่เรามีอินเทอร์เน็ตก็สามารถ ใช้งานเว็บไซต์เว็บออนไลน์และสามารถสมัครสมาชิกได้ตลอด 24 ชั่วโมง สมัคร 138BET