<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<style>
v\:*{behavior:url(#default#VML);}o\:*{behavior:url(#default#VML);}
</style>
<body>
        <v:Rect id="dk" style="position:absolute;width:800;height:400px;left:250px;top:200px">
                <v:extrusion on="true" backdepth="20" type="parallel" color="blue" />
        </v:Rect>
        <v:Rect id="xk" style="position:absolute;width:40;height:40px;left:250px;top:400px">
                <v:extrusion on="true" backdepth="20" type="parallel" color="red" />
        </v:Rect>
</body>
<SCRIPT language="javascript">
var r=document.all["dk"];
var r1=document.all["xk"];
r.extrusion.rotationangle="90,0";
r1.extrusion.rotationangle="90,0";
var t=0;
function xz()
{
t+=1;
r.Rotation=t;
}
function document.onkeydown()
{
if(window.event.keyCode==38)
{
setInterval(xz,20);
}
}
</script>
</html>
按↑开始旋转
怎样使小木块在大木块中的位置不变跟着它旋转
有什么实现方法吗
请高手指教

解决方案 »

  1.   

    function xz() 

    t+=1; 
    r.Rotation=t; 
    r1.Rotation=t; 

      

  2.   

    function xz() 

    t+=1; 
    r.Rotation=t; 
    r1.Rotation=t; 

      

  3.   

    我靠, vml无比强大呀,长见识,大伙别笑我。
    看来要研究一下。~
      

  4.   

    flesu
    我是说让小木块在大木块"中"的位置不变跟着旋转
    你这个只是小木块在原地自己旋转
      

  5.   

    用Group容器
    <v:group ID="group1" style="position:relative;WIDTH:400px;HEIGHT:400px;" coordsize = "2000,2000">
            <v:Rect id="dk" style="position:relative;width:400;height:400px;left:250px;top:200px"> 
                    <v:extrusion on="true" backdepth="20" type="parallel" color="blue" /> 
            </v:Rect> 
            <v:Rect id="xk" style="position:relative;width:40;height:40px;left:250px;top:400px"> 
                    <v:extrusion on="true" backdepth="20" type="parallel" color="red" /> 
            </v:Rect> 
       </v:group>
    function xz() 

    t+=1; 
    //r.Rotation=t; 
    //r1.Rotation=t; 
    g1.Rotation=t; 
      

  6.   

    flesu
    谢谢你的回答
    不过你在回答之前有试过效果吗
    group容器的旋转只能是3d中的y轴旋转
    我要的是z轴旋转
      

  7.   

    zhege 这个我响了很久也想不到
      

  8.   

    平面的情况下加入到group中,旋转group就可以了,但是现在是3D效果,在旋转的时候,3D的元素,不同的旋转角度,位置就不相同,这里面的计算太复杂了。。
    LZ可以联系那个风云舞,他是vml专家。