WPF3D
다이렉트3D의 기반 위에서 만들어졌다. 2D/3D 그래픽과 텍스트는 3차원의 삼각형,텍스쳐 및 다른 다이렉트3D 객체로 전환되어 하드웨어에 의해서 렌더링된다.
WPF의 3D API들은 닷넷 프레임워크의 다른 부분들처럼 접근하기 쉽고 편리하도록 설계되었다.
WPF로 3D그래픽 화면을 보여주려면 , 프로그래밍 코드와 XAML만으로도 프로그램을 충분히 작성할수 있으며, 셰이프와 드로잉을 사용하던 방식과 유사하게 3D객체들을 생성해야 한다. 물론 WPF는 보유 모드를 지원하기 때문에 무효화나 다시 드로잉해야 되는 부분들을 시스템이 알아서 처리 해 준다.
예) 모델3D를 사용해서 만들어낸 집
<Window x:Class="ex1.Window1"
Background="Black"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Grid>
<Viewport3D>
<Viewport3D.Camera>
<OrthographicCamera Position="5,5,5" LookDirection="-1,-1,-1" Width="5"/>
</Viewport3D.Camera>
<Viewport3D.Children>
<ModelVisual3D x:Name="Light">
<ModelVisual3D.Content>
<AmbientLight/>
</ModelVisual3D.Content>
</ModelVisual3D>
<ModelVisual3D>
<ModelVisual3D.Content>
<Model3DGroup x:Name="House">
<GeometryModel3D x:Name="Roof">
<GeometryModel3D.Material>
<DiffuseMaterial Brush="Blue"/>
</GeometryModel3D.Material>
<GeometryModel3D.Geometry>
<MeshGeometry3D Positions="-1,1,1 0,2,1 0,2,-1 -1,1,-1 0,2,1 1,1,1 1,1,-1 0,2,-1"
TriangleIndices="0 1 2 0 2 3 4 5 6 4 6 7"/>
</GeometryModel3D.Geometry>
</GeometryModel3D>
<GeometryModel3D x:Name="Sides">
<GeometryModel3D.Material>
<DiffuseMaterial Brush="Green"/>
</GeometryModel3D.Material>
<GeometryModel3D.Geometry>
<MeshGeometry3D Positions="-1,1,1 -1,1,-1 -1,-1,-1 -1,-1,1 1,1,-1 1,1,1 1,-1,1 1,-1,-1"
TriangleIndices="0 1 2 0 2 3 4 5 6 4 6 7"/>
</GeometryModel3D.Geometry>
</GeometryModel3D>
<GeometryModel3D x:Name="Ends">
<GeometryModel3D.Material>
<DiffuseMaterial Brush="Red"/>
</GeometryModel3D.Material>
<GeometryModel3D.Geometry>
<MeshGeometry3D Positions="-0.25,0,1 -1,1,1 -1,-1,1 -0.25,-1,1 -0.25,0,1
-1,-1,1 0.25,0,1 1,-1,1 1,1,1 0.25,0,1 0.25,-1,1 1,-1,1
1,1,1 0,2,1 -1,1,1 -1,1,1 -0.25,0,1 0.25,0,1 1,1,1 1,1,-1
1,-1,-1 -1,-1,-1 -1,1,-1 1,1,-1 -1,1,-1 0,2,-1"
TriangleIndices="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 15 17
18 19 20 21 19 21 19 21 22 23 24 25"/>
</GeometryModel3D.Geometry>
</GeometryModel3D>
</Model3DGroup>
</ModelVisual3D.Content>
</ModelVisual3D>
</Viewport3D.Children>
</Viewport3D>
</Grid>
</Window>

첫댓글 LookDirection을 같이 바꿔야 시점이 변환하네요..