■ SpotLight 엘리먼트 사용하기

------------------------------------------------------------------------------------------------------------------------


TestProject.zip


MainWindow.xaml

 

 

<Window x:Class="TestProject.MainWindow"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Width="800"

    Height="600"

    Title="SpotLight 엘리먼트 사용하기"

    FontFamily="나눔고딕코딩"

    FontSize="16">

    <Viewport3D>

        <ModelVisual3D>

            <ModelVisual3D.Content>

                <GeometryModel3D>

                    <GeometryModel3D.Geometry>

                        <MeshGeometry3D

                            Positions="0 0 0, 1 0 0, 2 0 0, 3 0 0, 4 0 0, 5 0 0, 6 0 0, 7 0 0, 8 0 0, 9 0 0,

                                       0 1 0, 1 1 0, 2 1 0, 3 1 0, 4 1 0, 5 1 0, 6 1 0, 7 1 0, 8 1 0, 9 1 0,

                                       0 2 0, 1 2 0, 2 2 0, 3 2 0, 4 2 0, 5 2 0, 6 2 0, 7 2 0, 8 2 0, 9 2 0,

                                       0 3 0, 1 3 0, 2 3 0, 3 3 0, 4 3 0, 5 3 0, 6 3 0, 7 3 0, 8 3 0, 9 3 0,

                                       0 4 0, 1 4 0, 2 4 0, 3 4 0, 4 4 0, 5 4 0, 6 4 0, 7 4 0, 8 4 0, 9 4 0,

                                       0 5 0, 1 5 0, 2 5 0, 3 5 0, 4 5 0, 5 5 0, 6 5 0, 7 5 0, 8 5 0, 9 5 0,

                                       0 6 0, 1 6 0, 2 6 0, 3 6 0, 4 6 0, 5 6 0, 6 6 0, 7 6 0, 9 6 0, 9 6 0,

                                       0 7 0, 1 7 0, 2 7 0, 3 7 0, 4 7 0, 5 7 0, 6 7 0, 7 7 0, 8 7 0, 9 7 0,

                                       0 8 0, 1 8 0, 2 8 0, 3 8 0, 4 8 0, 5 8 0, 6 8 0, 7 8 0, 8 8 0, 9 8 0,

                                       0 9 0, 1 9 0, 2 9 0, 3 9 0, 4 9 0, 5 9 0, 6 9 0, 7 9 0, 8 9 0, 9 9 0"

                            TriangleIndices=" 0  1 10, 1  2 11, 2  3 12, 3  4 13, 4  5 14, 5  6 15, 6  7 16, 7  8 17, 8  9 18,

                                              1 11 10, 2 12 11, 3 13 12, 4 14 13, 5 15 14, 6 16 15, 7 17 16, 8 18 17, 9 19 18,

                                             10 11 20,11 12 21,12 13 22,13 14 23,14 15 24,15 16 25,16 17 26,17 18 27,18 19 28,

                                             11 21 20,12 22 21,13 23 22,14 24 23,15 25 24,16 26 25,17 27 26,18 28 27,19 29 28,

                                             20 21 30,21 22 31,22 23 32,23 24 33,24 25 34,25 26 35,26 27 36,27 28 37,28 29 38,

                                             21 31 30,22 32 31,23 33 32,24 34 33,25 35 34,26 36 35,27 37 36,28 38 37,29 39 38,

                                             30 31 40,31 32 41,32 33 42,33 34 43,34 35 44,35 36 45,36 37 46,37 38 47,38 39 48,

                                             31 41 40,32 42 41,33 43 42,34 44 43,35 45 44,36 46 45,37 47 46,38 48 47,39 49 48,

                                             40 41 50,41 42 51,42 43 52,43 44 53,44 45 54,45 46 55,46 47 56,47 48 57,48 49 58,

                                             41 51 50,42 52 51,43 53 52,44 54 53,45 55 54,46 56 55,47 57 56,48 58 57,49 59 58,

                                             50 51 60,51 52 61,52 53 62,53 54 63,54 55 64,55 56 65,56 57 66,57 58 67,58 59 68,

                                             51 61 60,52 62 61,53 63 62,54 64 63,55 65 64,56 66 65,57 67 66,58 68 67,59 69 68,

                                             60 61 70,61 62 71,62 63 72,63 64 73,64 65 74,65 66 75,66 67 76,67 68 77,68 69 78,

                                             61 71 70,62 72 71,63 73 72,64 74 73,65 75 74,66 76 75,67 77 76,68 78 77,69 79 78,

                                             70 71 80,71 72 81,72 73 82,73 74 83,74 75 84,75 76 85,76 77 86,77 78 87,78 79 88,

                                             71 81 80,72 82 81,73 83 82,74 84 83,75 85 84,76 86 85,77 87 86,78 88 87,79 89 88,

                                             80 81 90,81 82 91,82 83 92,83 84 93,84 85 94,85 86 95,86 87 96,87 88 97,88 89 98,

                                             81 91 90,82 92 91,83 93 92,84 94 93,85 95 94,86 96 95,87 97 96,88 98 97,89 99 98" />

                    </GeometryModel3D.Geometry>

                    <GeometryModel3D.Material>

                        <DiffuseMaterial Brush="RoyalBlue" />

                    </GeometryModel3D.Material>

                </GeometryModel3D>

            </ModelVisual3D.Content>

        </ModelVisual3D>

        <ModelVisual3D>

            <ModelVisual3D.Content>

                <SpotLight

                    Position="4.5 4.5 10"

                    Direction="0 0 -1"

                    InnerConeAngle="30"

                    OuterConeAngle="45" />

            </ModelVisual3D.Content>

        </ModelVisual3D>

        <Viewport3D.Camera>

            <PerspectiveCamera

                Position="4.5 4.5 50"

                LookDirection="0 0 -1"

                UpDirection="0 1 0"

                FieldOfView="22.5" />

        </Viewport3D.Camera>

    </Viewport3D>

</Window>

 

------------------------------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker

댓글을 달아 주세요