Files
zhengte.babylonjs-sdk/examples/global-demo.html
yinsx ae59fbe68b
All checks were successful
continuous-integration/drone/push Build is passing
增加环境背景参数
2026-01-07 15:23:21 +08:00

69 lines
1.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SDK ȫ<>ֹ<EFBFBD><D6B9>ؼ<EFBFBD><D8BC><EFBFBD>ʾ<EFBFBD><CABE></title>
</head>
<body>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
overflow: hidden;
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
#app {
width: 100vw;
height: 100vh;
position: relative;
}
#renderDom {
width: 100%;
height: 100%;
display: block;
}
</style>
<canvas id="renderDom"></canvas>
<script src="https://sdk.zguiy.com/zt/assets/index.global.js"></script>
<script>
const config = {
container: 'renderDom',
modelUrlList: ['https://sdk.zguiy.com/resurces/model/model.glb'],
env: { envPath: 'https://sdk.zguiy.com/resurces/hdr/hdr.env', intensity: 1.2, rotationY: 0.3 },
};
const sdkKernel = window.faceSDK && window.faceSDK.kernel;
if (!sdkKernel) {
console.error('faceSDK kernel is not available. Confirm index.global.js loaded correctly.');
} else {
sdkKernel.init(config);
sdkKernel.on('model:load:progress', (data) => {
console.log('加载模型中', data);
});
sdkKernel.on('model:loaded', (data) => {
console.log('模型加载完成', data);
});
sdkKernel.on('model:click', (data) => {
console.log('模型点击事件', data);
});
}
</script>
</body>
</html>