none
3D中 图片 或 控件 显示的问题 RRS feed

  • 问题

  •  <ContainerUIElement3D x:Name="container">
                        <ContainerUIElement3D.Children>
                            <ModelUIElement3D>
                                <ModelUIElement3D.Model>
                                    <GeometryModel3D>
                                        <GeometryModel3D.Geometry>
                                            <MeshGeometry3D Positions="0.5,0.5,-0.0 -0.5,0.5,-0.0 -0.5,-0.5,-0.0 -0.5,-0.5,-0.0 0.5,-0.5,-0.0 0.5,0.5,-0.0"/>
                                        </GeometryModel3D.Geometry>
                                        <GeometryModel3D.Material>
                                            <DiffuseMaterial>
                                                <DiffuseMaterial.Brush>
                                                    <ImageBrush>
                                                        <ImageBrush.ImageSource>
                                                            <BitmapImage UriSource="C:\Users\HeroHua\Desktop\Penguins.jpg"/>
                                                        </ImageBrush.ImageSource>
                                                    </ImageBrush>
                                                </DiffuseMaterial.Brush>
                                            </DiffuseMaterial>
                                        </GeometryModel3D.Material>
                                        <GeometryModel3D.BackMaterial>
                                            <DiffuseMaterial Brush="Blue"/>
                                        </GeometryModel3D.BackMaterial>
                                    </GeometryModel3D>
                                </ModelUIElement3D.Model>
                                <ModelUIElement3D.Transform>
                                    <Transform3DGroup>
                                        <TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0"/>
                                        <RotateTransform3D>
                                            <RotateTransform3D.Rotation>
                                                <AxisAngleRotation3D Angle="0" Axis="1,0,0"/>
                                            </RotateTransform3D.Rotation>
                                        </RotateTransform3D>
                                        <ScaleTransform3D ScaleX="1" ScaleY="1" ScaleZ="1"/>
                                    </Transform3DGroup>
                                </ModelUIElement3D.Transform>
                            </ModelUIElement3D>
                        </ContainerUIElement3D.Children>
                        <ContainerUIElement3D.Transform>
                            <Transform3DGroup>
                                <TranslateTransform3D x:Name="contTrans" OffsetX="0" OffsetY="0" OffsetZ="0"/>
                                <ScaleTransform3D ScaleX="1" ScaleY="1" ScaleZ="1"/>
                                <RotateTransform3D>
                                    <RotateTransform3D.Rotation>
                                        <AxisAngleRotation3D x:Name="contAngle" Angle="0" Axis="0,1,0"/>
                                    </RotateTransform3D.Rotation>
                                </RotateTransform3D>
                            </Transform3DGroup>
                        </ContainerUIElement3D.Transform>
                    </ContainerUIElement3D>
    下划线部分的问题,如果上面的Brush属性直接给个颜色的话是可以显示的.但是换成图片,怎么就不行了呢
    
    我用VisualBrush也试了,也不行,不知道是不是写法有问题
    


    Hero

    2011年10月12日 2:50

答案

全部回复