27 lines
773 B
HTML
27 lines
773 B
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>SDK 模块化加载示例</title>
|
||
</head>
|
||
<body>
|
||
<canvas id="renderDom"></canvas>
|
||
|
||
<!-- 模块化:Dev 使用 /src/main.ts,构建后改为 /assets/index.js -->
|
||
<script type="module">
|
||
import { kernel } from 'https://sdk.zguiy.com/zt/assets/index.js';
|
||
|
||
const config = {
|
||
container: 'renderDom',
|
||
modelUrlList: ['/public/model/model.glb'],
|
||
env: { hdrPath: '/hdr/hdr.env', intensity: 1.2, rotationY: 0.3 },
|
||
onSuccess: () => console.log('SDK initialized (module)'),
|
||
onError: (err) => console.error('SDK init error', err),
|
||
};
|
||
|
||
kernel.init(config);
|
||
</script>
|
||
</body>
|
||
</html>
|