积极答复者
Bob Bao 求解 3D UIElement 显示问题

问题
答案
-
是你的纹理只取了一半都是 0.5 处的,而且切割坐标对应都有问题:
这张图是你的坐标对应,正好把图弄反了;而且纹理本身是没有负坐标的,都应该是大于0的。
正确的应该是:
<Viewport2DVisual3D > <Viewport2DVisual3D.Geometry> <!--<MeshGeometry3D Positions=".5,.5,0 .5,-.5,0 -.5,-.5,0 -.5,.5,0" TriangleIndices="1,0,2 0,3,2" TextureCoordinates="1,-1 1,1 -1,1 -1,-1 "/>--> <MeshGeometry3D Positions="-.5,.5,0 -.5,-.5,0 .5,-.5,0 .5,.5,0" TextureCoordinates="0,0 0,1 1,1 1,0" TriangleIndices="0 1 2 0 2 3"/> </Viewport2DVisual3D.Geometry>
Sincerely,
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 HeroHua0509 2011年10月16日 14:49
全部回复
-
我运行了你的例子,但不是很明白你的问题,究竟是哪里出了错? 哪边你认为位置不对了?
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
我们在贴材质的时候,三角形各个点的顺序会影响到你材质上去后的方向,你检查下是不是这个导致了位置不对。
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
是你的纹理只取了一半都是 0.5 处的,而且切割坐标对应都有问题:
这张图是你的坐标对应,正好把图弄反了;而且纹理本身是没有负坐标的,都应该是大于0的。
正确的应该是:
<Viewport2DVisual3D > <Viewport2DVisual3D.Geometry> <!--<MeshGeometry3D Positions=".5,.5,0 .5,-.5,0 -.5,-.5,0 -.5,.5,0" TriangleIndices="1,0,2 0,3,2" TextureCoordinates="1,-1 1,1 -1,1 -1,-1 "/>--> <MeshGeometry3D Positions="-.5,.5,0 -.5,-.5,0 .5,-.5,0 .5,.5,0" TextureCoordinates="0,0 0,1 1,1 1,0" TriangleIndices="0 1 2 0 2 3"/> </Viewport2DVisual3D.Geometry>
Sincerely,
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 HeroHua0509 2011年10月16日 14:49