블로그 이미지
Magic_kit
study 관련자료를 한곳으로 자기 개발 목적으로 재태크 재무 관리 목적으로 일상생활의 팁을 공유 하기 위하여 블로그를 개설 하였습니다.

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Category

Recent Post

Recent Comment

Archive

2009. 11. 27. 12:28 .Net Project/SilverLight 3.0
반응형
  3D Perspective
- 실버라이트3에 새롭게 추가된 기능
- Full 3D가 아닌 2D객체를 3D 공간에 배치하여 마치 3D 객체인 것처럼 보이게 하는 기능입니다
- 일반적인 3D에서는 객체를 두고 카메라의 위치를 변경 하지만,
   Perspective 3D 에서는 객체를 회전하여 3D효과를 나타냅니다
- Rotation(X,Y,Z) 프로퍼티  : 회전 각도 설정
- CenterOfRotation(X,Y,Z) 프로퍼티 : 방향의 회전축 설정
- GlobalOffset(X,Y,Z) 프로퍼티 : 중심 객체 이동
-LocalOffset(X,Y,Z) 프로퍼티 : 중심 객체 이동

 

 Perspective.Xaml

<UserControl x:Class="PlaneProjectionExample.MainPage"

    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"

    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">

    <StackPanel x:Name="LayoutRoot"
                 
 Width="600" Height="400"
                  
 Background="White" Orientation="Vertical">

        <StackPanel Width="300" Height="200"
                  
 Orientation="Vertical"
                  
 Background="Orange" Margin="0,50,0,0">

            <StackPanel.Projection>

                <!-- PlaneProjection 프로퍼티 -->

                <PlaneProjection x:Name="planeProjection" />

            </StackPanel.Projection>

 

            <TextBlock Text="PlaneProject Example" />

            <TextBlock Text="Input Text" />

            <Button Content="버튼" />

            <Ellipse Width="50" Height="50" Fill="Blue"/>

 

        </StackPanel>

 

        <!-- 카테고리 -->

        <StackPanel Orientation="Horizontal" Margin="0,50,0,0">

            <TextBlock Text="Category" Width="150" TextAlignment="Center"/>

            <TextBlock Text="X" Width="150" TextAlignment="Center"/>

            <TextBlock Text="Y" Width="150" TextAlignment="Center"/>

            <TextBlock Text="Z" Width="150" TextAlignment="Center"/>

        </StackPanel>

 

        <!-- Rotation 그룹 -->

        <StackPanel Orientation="Horizontal">

            <TextBlock Text="Rotation" Width="150" TextAlignment="Center"/>

            <!-- Rotation(X, Y, Z) 프로퍼티 데이터 바인딩 -->

            <Slider x:Name="RotationX" Width="150" Minimum="0" Maximum="360"

                    Value="{Binding RotationX,
                          
 ElementName=planeProjection, Mode=TwoWay}"/>

            <Slider x:Name="RotationY" Width="150" Minimum="0" Maximum="360"

                    Value="{Binding RotationY,
                            ElementName
=planeProjection, Mode=TwoWay}"/>

            <Slider x:Name="RotationZ" Width="150" Minimum="0" Maximum="360"

                    Value="{Binding RotationZ,
                          
 ElementName=planeProjection, Mode=TwoWay}"/>

        </StackPanel>

 

        <!-- CenterOfRotation 그룹 -->

        <StackPanel Orientation="Horizontal">

            <TextBlock Text="CenterOfRotation" Width="150" TextAlignment="Center"/>

            <!-- CenterOfRotation(X, Y, Z) 데이터 바인딩 -->

            <Slider x:Name="CenterOfRotationX" Width="150" Minimum="0" Maximum="1"

                    Value="{Binding CenterOfRotationX, ElementName=planeProjection, Mode=TwoWay}"/>

            <Slider x:Name="CenterOfRotationY" Width="150" Minimum="0" Maximum="1"

                    Value="{Binding CenterOfRotationY, ElementName=planeProjection, Mode=TwoWay}"/>

            <Slider x:Name="CenterOfRotationZ" Width="150" Minimum="0" Maximum="1"

                    Value="{Binding CenterOfRotationZ, ElementName=planeProjection, Mode=TwoWay}"/>

        </StackPanel>

 

        <!-- GlobalOffset 그룹-->

        <StackPanel Orientation="Horizontal">

            <TextBlock Text="GlobalOffset" Width="150" TextAlignment="Center"/>

            <!-- GlobalOffset(X, Y, Z) 데이터 바인딩 -->

            <Slider x:Name="GlobalOffsetX" Width="150" Minimum="-50" Maximum="50"

                    Value="{Binding GlobalOffsetX,
                           
 ElementName=planeProjection, Mode=TwoWay}"/>

            <Slider x:Name="GlobalOffsetY" Width="150" Minimum="-50" Maximum="50"

                    Value="{Binding GlobalOffsetY,
                          
 ElementName=planeProjection, Mode=TwoWay}"/>

            <Slider x:Name="GlobalOffsetZ" Width="150" Minimum="-50" Maximum="50"

                    Value="{Binding GlobalOffsetZ,
                            ElementName
=planeProjection, Mode=TwoWay}"/>

        </StackPanel>

 

        <!-- LocalOffset 그룹 -->

        <StackPanel Orientation="Horizontal">

            <TextBlock Text="LocalOffset" Width="150" TextAlignment="Center"/>

            <!-- LocalOffset(X, Y, Z) 데이터 바인딩. -->

            <Slider x:Name="LocalOffsetX" Width="150" Minimum="-50" Maximum="50"

                    Value="{Binding LocalOffsetX,
                            ElementName=planeProjection, Mode=TwoWay}"/>

            <Slider x:Name="LocalOffsetY" Width="150" Minimum="-50" Maximum="50"

                    Value="{Binding LocalOffsetY,
                          
 ElementName=planeProjection, Mode=TwoWay}"/>

            <Slider x:Name="LocalOffsetZ" Width="150" Minimum="-50" Maximum="50"

                    Value="{Binding LocalOffsetZ,
                            ElementName
=planeProjection, Mode=TwoWay}"/>

        </StackPanel>

    </StackPanel>

</UserControl> 





반응형
posted by Magic_kit