VML之带背景的3D图形任意旋转
2007-11-13 15:37
344 查看
[align=left]利用VML及JS实现在shape上带有背景图象并可以任意旋,并具有及3D效果,
注:如果IE上不能显示VML,需要下载vgx.dll并regsvr32即可![/align]
<script>
function SetRotation(deg)
{
var deg2rad=Math.PI*2/360;
rad=deg*deg2rad;
costheta = Math.cos(rad);
sintheta = Math.sin(rad);
var oDiv=document.all("r1");
with (oDiv.filters.item(0))
{
M11=costheta;
M12=-sintheta;
M21=sintheta;
M22=costheta;
}
}
</script>
<center>
<?import namespace = v urn = "urn:schemas-microsoft-com:vml" implementation = "#default#VML" declareNamespace />
<table>
<tr><td>
<input type=text value=40 id=txtangle>
<input type=button onclick="SetRotation(document.all.txtangle.value);" value="rotate">
</td></tr>
<tr><td>
<v:shape id=r1 style="filter:progid:DXImageTransform.Microsoft.Matrix(M11=1.0, sizingmethod='auto expand');
Z-INDEX:1;WIDTH:200;HEIGHT:500" coordsize="100,100" filled="t" strokecolor="blue" path="m0,0 l30,30,60,0,0,0 e">
<v:extrusion on="t" backdepth="20pt" color="white" diffusity="1" rotationangle="100,-100" />
<v:fill src="http://www.baidu.com/img/logo.gif" type="frame" opacity="1"/>
</v:shape>
</td></tr>
</table>
</center>
注:如果IE上不能显示VML,需要下载vgx.dll并regsvr32即可![/align]
<script>
function SetRotation(deg)
{
var deg2rad=Math.PI*2/360;
rad=deg*deg2rad;
costheta = Math.cos(rad);
sintheta = Math.sin(rad);
var oDiv=document.all("r1");
with (oDiv.filters.item(0))
{
M11=costheta;
M12=-sintheta;
M21=sintheta;
M22=costheta;
}
}
</script>
<center>
<?import namespace = v urn = "urn:schemas-microsoft-com:vml" implementation = "#default#VML" declareNamespace />
<table>
<tr><td>
<input type=text value=40 id=txtangle>
<input type=button onclick="SetRotation(document.all.txtangle.value);" value="rotate">
</td></tr>
<tr><td>
<v:shape id=r1 style="filter:progid:DXImageTransform.Microsoft.Matrix(M11=1.0, sizingmethod='auto expand');
Z-INDEX:1;WIDTH:200;HEIGHT:500" coordsize="100,100" filled="t" strokecolor="blue" path="m0,0 l30,30,60,0,0,0 e">
<v:extrusion on="t" backdepth="20pt" color="white" diffusity="1" rotationangle="100,-100" />
<v:fill src="http://www.baidu.com/img/logo.gif" type="frame" opacity="1"/>
</v:shape>
</td></tr>
</table>
</center>
相关文章推荐
- MFC下图形任意角度旋转.
- VB.NET 中图形旋转任意角度 [ZT]
- 图形图像处理-之-任意角度的高质量的快速的图像旋转 下篇 补充话题
- 【转】Silverlight用代码实现对任意控件向4个方向进行3D旋转
- MFC下图形任意角度旋转.
- 3D数学--学习笔记(三):3D中绕任意轴的旋转
- 图形图像处理-之-任意角度的高质量的快速的图像旋转 上篇 纯软件的任意角度的快速旋转
- OpenGL3D图形、旋转、纹理、键盘移动、光照、滤波、透明(完整) 转自http://www.cnblogs.com/tiandsp/archive/2012/01/23/2329049.html
- SilverLight用代码实现对任意控件向4个方向进行3D旋转的类
- visio任意角度精确旋转图形
- 图形图像处理-之-任意角度的高质量的快速的图像旋转 下篇 补充话题
- visio中图形旋转任意角度
- 图形图像处理-之-任意角度的高质量的快速的图像旋转 下篇 高质量的旋转
- css3 3d图形旋转显示
- 文章预告-3D中绕任意轴的旋转
- 图形图像处理-之-任意角度的高质量的快速的图像旋转 上篇 纯软件的任意角度的快速旋转
- FB图形例题3D旋转【VFB源码】
- 3D图形学-----绕任意轴旋转
- 图形图像处理-之-任意角度的高质量的快速的图像旋转 中篇 高质量的旋转
- java 实现图片任意角度旋转,及背景透明