Probably I understand things wrong, but I am facing an issue in my iPhone, testing 3d rotation of .mov video.
Code without rotation:
<html>
<head>
</head>
<body>
<video autoplay loop muted playsinline src="vid.mov" style="position:absolute;top:10px;background:transparent;">Support!</video>
</body>
</html>
Result:
Code with rotation:
<html>
<head>
</head>
<body>
<video autoplay loop muted playsinline src="vid.mov" style="position:absolute;top:10px;transform:rotateY(40deg);background:transparent;">Support!</video>
</body>
</html>
Result:
I have been trying rotate3d
perspective(100px)
-webkit-transform
- the result is the same.
Why it is not trapezoidal?
You need to add the perspective property to the parent of the element that is rotated. In this case, the body:
body {
perspective: 1000px;
}
Edit: Yeah it can also be applied to the element
.scene {
width: 200px;
height: 200px;
border: 1px solid #CCC;
margin: 40px;
}
.panel {
width: 100%;
height: 100%;
background: red;
/* perspective function in transform property */
transform: perspective(600px) rotateY(45deg);
}
<div class="scene">
<div class="panel"></div>
</div>