3d旋转

Posted junyi-bk

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了3d旋转相关的知识,希望对你有一定的参考价值。

<!DOCTYPE html>
<html>
<head>
<meta charset=UTF-8>
<title></title>

</head>
<body>
<style type="text/css">
#rotate3D 
    width: 80px;
    height: 70px;
    color: white;
    position: relative;
    font-weight: bold;
    font-size: 15px;
    padding: 10px;
    float: left;
    margin-right: 50px;
    border-radius: 5px;
    border: 1px solid #000000;
    background: red;
    margin: 10px;

</style>
<script type="text/javascript">


var x,y,n=0,ny=0,rotINT,rotYINT

function rotateYDIV()

y=document.getElementById("rotate3D")
clearInterval(rotYINT)
rotYINT=setInterval("startYRotate()",5)


function startYRotate()

ny=ny+5
y.style.transform="rotateY(" + ny + "deg)"
y.style.webkitTransform="rotateY(" + ny + "deg)"
y.style.OTransform="rotateY(" + ny + "deg)"
y.style.MozTransform="rotateY(" + ny + "deg)"
if (ny==530 || ny>=1080)
    
    clearInterval(rotYINT)
    if (ny>=1080)ny=0
    



</script>

<div onmouseover="rotateYDIV()" id="rotate3D" style="transform: rotateY(0deg);">3D rotate</div>

</body>
</html>

 

以上是关于3d旋转的主要内容,如果未能解决你的问题,请参考以下文章

Unity 3D 物体旋转放大。

html5如何让图片3d旋转?

css3怎么让3d旋转的层近大远小

0068 3D 旋转:rotateXrotateYrotateZrotate3d

3d 矩阵旋转 - 对象奇怪地旋转

HTML 3D旋转特效,前端开发常用javascript特效_3D旋转