Click here to Skip to main content
15,892,059 members
Articles / Desktop Programming / WPF

Channel9 3D Explorer with gestures (hybrid smart client)

Rate me:
Please Sign up or sign in to vote.
4.88/5 (23 votes)
10 Mar 2009Ms-PL4 min read 34.1K   715   26  
An article on viewing Channel9's RSS posts
<UserControl x:Class="_3DView._3DViewControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:My3D="clr-namespace:_3DTools;assembly=3DTools"
             xmlns:tb="clr-namespace:Infragistics.ToyBox;assembly=Infragistics.ToyBox" Height="Auto">
    <UserControl.Resources>
        <!-- Objects mesh -->
        <MeshGeometry3D x:Key="ItemMesh" Positions="1.0 1.4 0.0 -1.0 1.4 0.0 -1.0 -1.4 0.0 1.0 -1.4 0.0"
                        Normals="0.0 0.0 -1.0 0.0 0.0 -1.0 0.0 0.0 -1.0 0.0 0.0 -1.0" TextureCoordinates="0,0 0,1 1,1 1,0"
                        TriangleIndices="0 1 2 0 2 3" />
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>                
            <RowDefinition Height="35"/>
        </Grid.RowDefinitions>
        
            <My3D:TrackballDecorator Grid.Row="0">
                <My3D:Interactive3DDecorator>
                    <Viewport3D>
                        <Viewport3D.Camera>
                            <PerspectiveCamera x:Name="MyCamera" Position="0,.5,4" LookDirection="0,0,-1" FieldOfView="110" />
                        </Viewport3D.Camera>
                        <My3D:InteractiveVisual3D x:Name="MyInteractiveVisual3D" IsBackVisible="False">
                            <My3D:InteractiveVisual3D.Children>

                            </My3D:InteractiveVisual3D.Children>
                        </My3D:InteractiveVisual3D>
                        <!--<My3D:ScreenSpaceLines3D Color="Red" Points="-10,0,0 10,0,0"/>
                    <My3D:ScreenSpaceLines3D Color="Blue" Points="0,-10,0 0,10,0"/>
                    <My3D:ScreenSpaceLines3D Color="Green" Points="0,0,-10 0,0,10"/>-->
                        <ModelVisual3D>
                            <ModelVisual3D.Children>
                                <ModelVisual3D>
                                    <ModelVisual3D.Content>
                                        <DirectionalLight Color="Transparent" Direction="0,0,5"/>
                                    </ModelVisual3D.Content>
                                </ModelVisual3D>
                                <ModelVisual3D>
                                    <ModelVisual3D.Content>
                                        <DirectionalLight Color="Transparent" Direction="0,0,-5"/>
                                    </ModelVisual3D.Content>
                                </ModelVisual3D>
                            </ModelVisual3D.Children>
                        </ModelVisual3D>
                    </Viewport3D>
                </My3D:Interactive3DDecorator>
            </My3D:TrackballDecorator>

        <Button Template="{StaticResource Buttons}" Grid.Row="1" ToolTip="Previous item" Margin="5,0,0,0"
                x:Name="LeftButton" Click="LeftButton_Click" Content="&lt;&lt;" FontWeight="Bold" VerticalAlignment="Bottom"
                    HorizontalAlignment="Left" Effect="{StaticResource DropShadowEffect}"></Button>
        
        <Button Template="{StaticResource Buttons}" Grid.Row="1" x:Name="RightButton" Click="RightButton_Click" FontWeight="Bold" VerticalAlignment="Bottom"
                    HorizontalAlignment="Right" Content="&gt;&gt;" ToolTip="Next item" Margin="0,0,5,0"
                Effect="{StaticResource DropShadowEffect}"></Button>

        <Button Template="{StaticResource Buttons}" Grid.Row="1" x:Name="FlipButton" Click="FlipButton_Click"  FontWeight="Bold" VerticalAlignment="Bottom"
                    HorizontalAlignment="Center" Content="Flip" Effect="{StaticResource DropShadowEffect}"></Button>

    </Grid>
</UserControl>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
Architect
Romania Romania
is a developer at LetsVR.ro.

Comments and Discussions