다음을 통해 공유


ModelUIElement3D.Model 속성

정의

렌더링할 Model3D를 가져오거나 설정합니다.

public:
 property System::Windows::Media::Media3D::Model3D ^ Model { System::Windows::Media::Media3D::Model3D ^ get(); void set(System::Windows::Media::Media3D::Model3D ^ value); };
public System.Windows.Media.Media3D.Model3D Model { get; set; }
member this.Model : System.Windows.Media.Media3D.Model3D with get, set
Public Property Model As Model3D

속성 값

렌더링할 Model3D입니다.

예제

다음 예제에 사용 하 여 두 개의 큐브를 만드는 방법을 보여 줍니다는 ModelUIElement3D 클래스:

<Viewport3D>
    <Viewport3D.Camera>
        <PerspectiveCamera Position="8,3,0" LookDirection="-8,-3,0" />
    </Viewport3D.Camera>
    
    <!-- The container has the two cubes as its children -->
    <ContainerUIElement3D MouseDown="ContainerMouseDown">
        <ContainerUIElement3D.Transform>
            <RotateTransform3D>
                <RotateTransform3D.Rotation>
                    <AxisAngleRotation3D x:Name="containerRotation" Axis="0, 1, 0" Angle="0" />
                </RotateTransform3D.Rotation>
            </RotateTransform3D>
        </ContainerUIElement3D.Transform>
        
        <!-- Cube 1 -->
        <ModelUIElement3D MouseDown="Cube1MouseDown">
            <ModelUIElement3D.Transform>
                <TranslateTransform3D OffsetZ="1.5" />
            </ModelUIElement3D.Transform>
            
            <ModelUIElement3D.Model>
                <GeometryModel3D Geometry="{StaticResource CubeMesh}">
                    <GeometryModel3D.Material>
                        <DiffuseMaterial x:Name="cube1Material" Brush="Blue" />
                    </GeometryModel3D.Material>
                </GeometryModel3D>
            </ModelUIElement3D.Model>
        </ModelUIElement3D>

        <!-- Cube 2 -->
        <ModelUIElement3D MouseDown="Cube2MouseDown">
            <ModelUIElement3D.Transform>
                <TranslateTransform3D OffsetZ="-1.5" />
            </ModelUIElement3D.Transform>
            
            <ModelUIElement3D.Model>
                <GeometryModel3D Geometry="{StaticResource CubeMesh}">
                    <GeometryModel3D.Material>
                        <DiffuseMaterial x:Name="cube2Material" Brush="Green" />
                    </GeometryModel3D.Material>
                </GeometryModel3D>
            </ModelUIElement3D.Model>
        </ModelUIElement3D>                
    </ContainerUIElement3D>
    
    <!-- Lights -->
    <ModelVisual3D>
        <ModelVisual3D.Content>
            <PointLight Color="White" Position="3, 10, 4" />
        </ModelVisual3D.Content>
    </ModelVisual3D>
</Viewport3D>

설명

종속성 속성 정보

식별자 필드 ModelProperty
메타 데이터 속성 설정 true 없음

적용 대상