Implementing 2d viewer using helix

158 views Asked by At

I want to use helix tool kit as 2D viewer with panning and zooming functionality. Need to show only line work with above functionality with MVVM support to lines.

1

There are 1 answers

0
dwpessoa On

First you will have to choose a plane to project (for example XY and ignore Z), then you can lock the rotation and hide the ViewCube.

You can choose other plans, but then you will have to test the camera position. In the example below I left ShowCameraInfo active, which helps to find the camera position.

Another thing, you can use "ZoomExtents()" method on a button to adjust the Zoom for your objects.

The orthographic projection option will also depend on what you think is best for your application...

<h:HelixViewport3D x:Name="MyPanel2D"
    ShowViewCube="False"
    IsPanEnabled="True"
    IsRotationEnabled="false"
    IsZoomEnabled="True"
    Orthographic="True"
    ShowCameraInfo="True">

    <hx:HelixViewport3D.Camera>
        <OrthographicCamera Position="0,0,20" LookDirection="0, 0, -11" UpDirection="0,1,0" NearPlaneDistance="0.125" Width="20"/>
    </hx:HelixViewport3D.Camera>

    <h:DefaultLights/>
    <hx:CubeVisual3D SideLength="7"/>
    <hx:CubeVisual3D SideLength="5" Fill="Red" Center="-5,3,0"/>

</h:HelixViewport3D>