Silverlight之三维透视效果(11)

代码下载

三维透视效果

记住以下关键点,找一些例子一看效果就明白了。

1)三维空间坐标,对象中心为坐标原点。

2)Y纵向向上为正,X横向向右为正,Z水平指向自己为正。

不用多讲看代码就明白:

<UserControl x:Class="SL.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">

<Grid x:Name="LayoutRoot" Background="White">
<Image Source="1.jpg" Width="200" Height="150">
<Image.Projection >
<!-- 三维透视效果 -->
<!--记住以下关键点,找一些例子一看效果就明白了。
1)三维空间坐标,对象中心为坐标原点。
2)Y纵向向上为正,X横向向右为正,Z水平指向自己为正。-->

<!-- 1.沿Y轴旋转45度-->
<!--<PlaneProjection RotationY="45"></PlaneProjection>-->
<!-- 2.沿X轴旋转60度-->
<!--<PlaneProjection RotationX="60"></PlaneProjection>-->
<!-- 3.沿Z轴旋转30度-->
<!--<PlaneProjection RotationZ="30"></PlaneProjection>-->

<!-- 4.沿XYZ轴综合旋转-->
<!--<PlaneProjection RotationY="45" RotationX="60" RotationZ="30"></PlaneProjection>-->

<!--5.默认中心点位于中对象的中线上,通过CenterOfRotationX,CenterOfRotationY,CenterOfRotationZ三个属性来改变中心位置,值范围0到1,两个极端,不是在这一侧就是那一侧,如果是0和1之间的值就按比例计算了,如0.5就是默认的中间位置。-->
<!--<PlaneProjection RotationY="45" RotationX="60" RotationZ="30" CenterOfRotationX="0.2" CenterOfRotationY="0.6" CenterOfRotationZ="1"></PlaneProjection>-->

<!--6.本地偏移:本地平移只是为了相对于屏幕平移-->
<!--<PlaneProjection RotationY="45" RotationX="60" RotationZ="30" LocalOffsetX="12" LocalOffsetY="20" LocalOffsetZ="30"></PlaneProjection>-->
<!--7.全局偏移:全局偏就是移动屏幕坐标,左加右减,上加下减。-->
<PlaneProjection RotationY="45" RotationX="-60" RotationZ="30" GlobalOffsetX="12" GlobalOffsetY="20" GlobalOffsetZ="30"></PlaneProjection>
</Image.Projection>
</Image>
</Grid>
</UserControl>
代码下载

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值