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

HelixViewport3d::SphereVisual3D - How to add children via XAML (and a back end binding)?

Anonymous 11 years ago updated by anonymous 6 years ago 3
This discussion was imported from CodePlex

BogusException wrote at 2014-07-18 19:15:

Experts,

I have the back end down. Right now, the XAML is the pain.

Given the following working XAML, how should I implement the backend collection of "Conns" (Connections, or Flights) in the Current Flight Demo code (which this came from)?

Below in the abbreviated XAML, this section toward the bottom is the one in question:
   <ItemsControl ItemsSource="{Binding Conns}">
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                    <Viewport3D /> <--- ??? or...?
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
    </ItemsControl>
I'm 100% on the backend. I just can't figure out how to make the XAML under Helix3D ready to bind to/show the collection...

Any help at all REALLY appreciated!!!

pat
:)
<Window x:Class="TheEarthWindow"
    x:Name="TheGlobe"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:t="clr-namespace:HelixToolkit.Wpf;assembly=HelixToolkit.Wpf" 
    Title="TheEarthWindow" Height="800" Width="800">
    <Grid>
        <Grid.Resources>
        [...]
        </Grid.Resources>
        <Grid.Triggers>
        [...]
        </Grid.Triggers>
        <t:HelixViewport3D x:Name="view1" 
                           Background="Black" 
                           CameraRotationMode="Turnball"
                           ClipToBounds="False"
                           Grid.Column="0" 
                           IsHeadLightEnabled="True" 
                           IsHitTestVisible="True"
                           IsPanEnabled="False"
                           IsZoomEnabled="True"
                           MouseDown="OnMouseDown" 
                           MouseMove="OnMouseMove" 
                           ShowCameraInfo="False"
                           ShowCameraTarget="False"
                           ShowCoordinateSystem="False"
                           ShowFieldOfView="False"
                           ShowFrameRate="True"
                           ShowTriangleCountInfo="False"
                           ShowViewCube="True"
                           SubTitle="vASA Global Monitor"
                           SubTitleSize="40"
                           Title="vASA"
                           ZoomExtentsWhenLoaded="True" >
            <t:HelixViewport3D.Camera>
                <PerspectiveCamera Position="600,27400,0" 
                                   LookDirection="0,1,0" 
                                   UpDirection="0,0,1" 
                                   NearPlaneDistance="0.01" 
                                   FarPlaneDistance="Infinity" 
                                   FieldOfView="40">
                    <PerspectiveCamera.Transform>
                    <Transform3DGroup>
                        <RotateTransform3D>
                            <RotateTransform3D.Rotation>
                                <AxisAngleRotation3D Axis="0,0,1" Angle="0" x:Name="camRotation" />
                            </RotateTransform3D.Rotation>
                        </RotateTransform3D>
                    </Transform3DGroup>
                    </PerspectiveCamera.Transform>
                </PerspectiveCamera>
            </t:HelixViewport3D.Camera>
            <t:SunLight />
            <t:SphereVisual3D x:Name="TheEarthSphere" 
                              Material="{StaticResource EarthJPG}"
                              Radius="1" 
                              ThetaDiv="25" 
                              PhiDiv="25" >
<!-- WHAT GOES HERE FOR TUBES? -->
        <ItemsControl ItemsSource="{Binding Conns}">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                        <Viewport3D /> <--- ??? or...?
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
        </ItemsControl>
<!-- IS THE ABOVE EVEN IN THE RIGHT PART OF THE TREE? -->
            </t:SphereVisual3D>
        </t:HelixViewport3D>
    </Grid>
</Window>
+1

Event that fires when the camera stops moving

Anonymous 11 years ago 0
This discussion was imported from CodePlex

everytimer wrote at 2014-07-31 21:24:

I need to perform an operation right after the user has stopped moving the camera (everytime he does it).

I'm doing it now by subscribing to every MouseEvent that allows interaction with the camera (specifically ButtonUp). The problem is that when the user has zoomed I don't have a way to know when he has stopped zooming. Other issue of capturing mouse events is that when the camera change has been generated programatically (set some saved view, etc) and there is some animation I can't do it either.

I would like to know if there is some event that I can subscribe to know when the Camera is "done", when it has stopped moving.

If such event doesn't exist I would like to know if it is possible to create one without modifying the source code of HelixToolKit and how it could be done.

Thank you very much.
0

How to join spheres to clusters?

its Win32nipuh 2 days ago 0

I have an app which creates spheres. Each sphere has property Database name. Is it possible to  join spheres to clusters by database name? I.e. to manipulate : rotate, zoom etc not all spheres but by subgroups (clusters)

Image 227

0

RR88

rr88institute1 2 months ago 0

RR88 là nền tảng cá cược trực tuyến uy tín, hoạt động hợp pháp với đầy đủ giấy phép và cam kết mang đến cho người chơi tại Việt Nam môi trường giải trí an toàn, minh bạch. Tại RR88, người dùng có thể trải nghiệm hệ sinh thái game phong phú gồm casino, cá cược thể thao, xổ số, bắn cá… tất cả được tích hợp trong một giao diện hiện đại, dễ sử dụng. Điểm nổi bật của RR88 là tốc độ giao dịch nạp – rút siêu nhanh, loạt chương trình khuyến mãi hấp dẫn mỗi ngày cùng đội ngũ chăm sóc khách hàng chuyên nghiệp, luôn sẵn sàng hỗ trợ 24/7.

Website: https://rr88.institute/

0

Kuwin

kuwin68town 3 months ago 0

Kuwin là thương hiệu cá cược trực tuyến hàng đầu, nổi bật với độ uy tín, minh bạch và dịch vụ chuẩn quốc tế. Với giao diện hiện đại, thân thiện và tốc độ truy cập mượt mà, Kuwin mang đến cho người chơi những trải nghiệm giải trí đỉnh cao, từ cá cược thể thao, casino trực tuyến, game bài đổi thưởng cho đến bắn cá, nổ hũ…

Website: https://kuwin68.town/

0

Flip the scene Horizontally

Darren Roberts (DarrenRobertsM 5 months ago updated by UU88 Net 3 months ago 2

using the mouse rotation feature I can rotate the scene and I can flip the scene Vertically. Same with the arrow key, left and right rotate and up/down flip vertically.  I can't flip Horizontally so i can view my 3D model from the side.  There must be a way.   I don't seem to be able to find any documentation on the Helix Toolkit so thought I'd ask here.  I'm sure it's really simple.

0

3D Background

Mick 1 year ago 0

I want to show skybox as background in my WPF application using helix.toolkit, but I don't know how to do that. 

Please help me if anyone knows.

Thanks

0

3d cube with colored cells

TheInevitable360 2 years ago updated by james vens 9 months ago 0

I am working on a code to build a 3D cube that has mesh/cell in each direction and each cell has its own color. now i sue this method which produces exactly what i want:

private void BuildCustomCube22(int x, int y, int z)
{
    double cubeSize = 1.0; // Size of each cube cell

    Random random = new Random();

    var modelGroup = new Model3DGroup();

    for (int i = 0; i < x; i++)
    {
        for (int j = 0; j < y; j++)
        {
            for (int k = 0; k < z; k++)
            {
                var position = new Point3D(
                    i * cubeSize + cubeSize / 2,
                    j * cubeSize + cubeSize / 2,
                   k * cubeSize + cubeSize / 2);

               // Generate a random color for each cube
               Color color = Color.FromRgb((byte)random.Next(256), (byte)random.Next(256),
               (byte)random.Next(256));

               var cube = new BoxVisual3D
               {
                   Center = position,
                   Width = cubeSize,
                   Height = cubeSize,
                   Length = cubeSize,
                  Material = MaterialHelper.CreateMaterial(color),

                };

               // Add the cube to the model group
               modelGroup.Children.Add(cube.Model);
           }
       }
   }

    // Add the model group to the viewport
    viewport.Children.Add(new ModelVisual3D { Content = modelGroup });
}

and the result is:

Image 195

The issue is when i increase mesh like 100*100*100, i get very poor performance like not being able to easily zoom in/out or move object around. I wonder how can i achieve the result i want event with high number of cells with no lag.

P.S: somebody told me: You are making way too many models. You can try to use Helix toolkit sharpdx version with instancing rendering capability

but i don't know if it can solve my issue and i don't know how to implement it. 

0

Is it possible to draw a simple text

Michael Insberg 3 years ago 0

Hi,

I want to draw a text with helix anny suggestions how to do that?

Greeting Michael

0

Rotating Label

Alberto 4 years ago 0

Hi, I made an application which render a panel that might have different texture on each side. The model is free of rotation over all axes. My boss asked me if would be possible to identify each panel side with a label (one digit for each side) and let it rotate with the panel... but sincerely I dunno how to achieve this, expecally to keep each label "in front" of the view point.

Any hints?


Image 181