-
Notifications
You must be signed in to change notification settings - Fork 23
/
obj2_basic.html
33 lines (30 loc) · 1.17 KB
/
obj2_basic.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html lang="en">
<head>
<title>OBJLoader2 basic</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<link type="text/css" rel="stylesheet" href="main.css" />
</head>
<body>
<canvas id="example" style="width: 100%; height: 100vh;"></canvas>
<div id="info">
OBJLoader2 basic
<div id="feedback" style="color: darkorange"></div>
</div>
<script type="module">
import { OBJLoader2BasicExample } from './src/examples/OBJLoader2BasicExample.ts';
import { executeExample } from './src/examples/ExampleCommons.ts';
const modelUrl = new URL('./models/obj/main/female02/female02.obj', window.location.href).href;
const materialUrl = new URL('./models/obj/main/female02/female02.mtl', window.location.href).href;
const canvas = document.getElementById('example');
const exampleApp = new OBJLoader2BasicExample(canvas, {
width: canvas?.offsetWidth ?? 0,
height: canvas?.offsetHeight ?? 0,
pixelRatio: window.devicePixelRatio
}, false)
exampleApp.setUrls(modelUrl, materialUrl);
executeExample(exampleApp);
</script>
</body>
</html>