matrix3d()函數是一個內置函數,用於應用變換以將3D變換創建為4×4齊次矩陣。
用法:
matrix3d( a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4 )
參數:該函數接受上麵提到和下麵描述的16個參數:
- a1,b1,c1,d1,a2,b2,c2,d2,a3,b3,c3,d3,d4:這些參數用於保存線性變換的值。
- a4,b4,c4:這些參數用於保存轉換值。
下麵的示例說明了CSS中的matrix3d()函數:
例:
<!DOCTYPE html>
<html>
<head>
<title>
CSS matrix3d() function
</title>
<style>
.GFG {
transform:matrix3d(
0.6, 0.1, 0.7, 0,
-0.5, 0.8, 0.1, 0,
-0.6, -0.5, 0.5, 0,
0, 0, 0, 1
);
font-size:26px;
font-weight:bold;
width:250px;
padding:20px;
background:green;
color:white;
font-family:sans-serif;
}
</style>
</head>
<body>
<center>
<h1 style="color:green">GeeksforGeeks</h1>
<h2>CSS matrix3d() function</h2>
<br><br>
<div class="GFG">
Welcome to GeeksforGeeks
</div>
</center>
</body>
</html>
輸出:
支持的瀏覽器:下麵列出了matrix3d()函數支持的瀏覽器:
- 穀歌瀏覽器
- IE瀏覽器
- 火狐瀏覽器
- 蘋果瀏覽器
- Opera
相關用法
- p5.js pan()用法及代碼示例
- PHP next()用法及代碼示例
- p5.js value()用法及代碼示例
- p5.js hue()用法及代碼示例
- p5.js box()用法及代碼示例
- d3.js d3.map.set()用法及代碼示例
- d3.js d3.max()用法及代碼示例
- p5.js tan()用法及代碼示例
- p5.js sin()用法及代碼示例
- PHP pow( )用法及代碼示例
- PHP each()用法及代碼示例
- d3.js d3.min()用法及代碼示例
注:本文由純淨天空篩選整理自jit_t大神的英文原創作品 CSS | matrix3d() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。