This commit is contained in:
@ -4,20 +4,44 @@
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<!-- <20><>ģ<EFBFBD>黯<EFBFBD><E9BBAF>ʹ<EFBFBD><CAB9>ȫ<EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFA3AC><EFBFBD>غ<EFBFBD><D8BA><EFBFBD>ͨ<EFBFBD><CDA8> window.faceSDK.kernel <20><><EFBFBD><EFBFBD> -->
|
||||
<!-- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> src <20>ij<EFBFBD>ʵ<EFBFBD>ʷ<EFBFBD><CAB7><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> https://doc.zguiy.com/sdk/zt/assets/index.global.js -->
|
||||
|
||||
<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: { hdrPath: 'https://sdk.zguiy.com/resurces/hdr/hdr.env', intensity: 1.2, rotationY: 0.3 },
|
||||
env: { envPath: 'https://sdk.zguiy.com/resurces/hdr/hdr.env', intensity: 1.2, rotationY: 0.3 },
|
||||
};
|
||||
|
||||
const sdkKernel = window.faceSDK && window.faceSDK.kernel;
|
||||
@ -28,18 +52,18 @@
|
||||
sdkKernel.init(config);
|
||||
|
||||
sdkKernel.on('model:load:progress', (data) => {
|
||||
console.log('ģ<EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>', data);
|
||||
console.log('加载模型中', data);
|
||||
});
|
||||
|
||||
sdkKernel.on('model:loaded', (data) => {
|
||||
console.log('ģ<EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', data);
|
||||
console.log('模型加载完成', data);
|
||||
});
|
||||
|
||||
sdkKernel.on('model:click', (data) => {
|
||||
console.log('ģ<EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>', data);
|
||||
console.log('模型点击事件', data);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
69
examples/index.html
Normal file
69
examples/index.html
Normal file
@ -0,0 +1,69 @@
|
||||
<!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>
|
||||
@ -45,7 +45,7 @@
|
||||
const config = {
|
||||
container: document.querySelector('#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 },
|
||||
env: { envPath: 'https://sdk.zguiy.com/resurces/hdr/hdr.env', intensity: 1.2, rotationY: 0.3,background: false },
|
||||
};
|
||||
|
||||
kernel.init(config);
|
||||
|
||||
@ -11,6 +11,7 @@ export const AppConfig = {
|
||||
env: {
|
||||
envPath: '/hdr/sanGiuseppeBridge.env',
|
||||
intensity: 1.5,
|
||||
rotationY: 0
|
||||
rotationY: 0,
|
||||
background: true,
|
||||
}
|
||||
};
|
||||
|
||||
@ -37,6 +37,24 @@ export class AppEnv extends Monobehiver {
|
||||
scene.environmentIntensity = intensity;
|
||||
scene.environmentTexture = reflectionTexture;
|
||||
this.object = reflectionTexture;
|
||||
scene.backgroundTexture = reflectionTexture;
|
||||
|
||||
const box = scene.createDefaultSkybox(
|
||||
reflectionTexture,
|
||||
true,
|
||||
512,
|
||||
0,
|
||||
true
|
||||
);
|
||||
console.log('box', AppConfig.env.background);
|
||||
if (AppConfig.env.background) {
|
||||
if (box) box.visibility = 1;
|
||||
} else {
|
||||
if (box) box.visibility = 0;
|
||||
}
|
||||
// 保存环境纹理的引用
|
||||
this.object = reflectionTexture;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -16,12 +16,11 @@ type InitParams = {
|
||||
container?: string | HTMLCanvasElement;
|
||||
modelUrlList?: string[];
|
||||
apiConfig?: ConfiguratorParams;
|
||||
onSuccess?: () => void;
|
||||
onError?: (error?: unknown) => void;
|
||||
env?: {
|
||||
hdrPath?: string;
|
||||
intensity?: number;
|
||||
rotationY?: number;
|
||||
background?: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user