1 Star 0 Fork 0

ing10010/verge3d-code-examples

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
misc_uv_tests.html 2.16 KB
一键复制 编辑 原始数据 按行查看 历史
Alexander Kovelenov 提交于 2021-02-11 18:05 +08:00 . Updated for Verge3D 3.6 release
<!DOCTYPE html>
<html lang="en">
<head>
<title>Verge3D - uv mapping tests</title>
<meta charset=utf-8 />
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
background: #ffffff;
color: #000000;
text-align: center;
font-family: sans-serif;
}
h3 {
margin-top: 60px;
margin-bottom: 30px;
font-weight: normal;
}
canvas {
width: 100%;
}
</style>
</head>
<body>
<script type="module">
import * as v3d from '../build/v3d.module.js';
import { UVsDebug } from './jsm/utils/UVsDebug.js';
/*
* This is to help debug UVs problems in geometry,
* as well as allow a new user to visualize what UVs are about.
*/
function test(name, geometry) {
const d = document.createElement('div');
d.innerHTML = '<h3>' + name + '</h3>';
d.appendChild(UVsDebug(geometry));
document.body.appendChild(d);
}
const points = [];
for (let i = 0; i < 10; i++) {
points.push(new v3d.Vector2(Math.sin(i * 0.2) * 15 + 50, (i - 5) * 2));
}
//
test('new v3d.PlaneBufferGeometry(100, 100, 4, 4)', new v3d.PlaneBufferGeometry(100, 100, 4, 4));
test('new v3d.SphereBufferGeometry(75, 12, 6)', new v3d.SphereBufferGeometry(75, 12, 6));
test('new v3d.IcosahedronBufferGeometry(30, 1)', new v3d.IcosahedronBufferGeometry(30, 1));
test('new v3d.OctahedronBufferGeometry(30, 2)', new v3d.OctahedronBufferGeometry(30, 2));
test('new v3d.CylinderBufferGeometry(25, 75, 100, 10, 5)', new v3d.CylinderBufferGeometry(25, 75, 100, 10, 5));
test('new v3d.BoxBufferGeometry(100, 100, 100, 4, 4, 4)', new v3d.BoxBufferGeometry(100, 100, 100, 4, 4, 4));
test('new v3d.LatheBufferGeometry(points, 8)', new v3d.LatheBufferGeometry(points, 8));
test('new v3d.TorusBufferGeometry(50, 20, 8, 8)', new v3d.TorusBufferGeometry(50, 20, 8, 8));
test('new v3d.TorusKnotBufferGeometry(50, 10, 12, 6)', new v3d.TorusKnotBufferGeometry(50, 10, 12, 6));
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/ing/verge3d-code-examples.git
git@gitee.com:ing/verge3d-code-examples.git
ing
verge3d-code-examples
verge3d-code-examples
master

搜索帮助