Skip to content

Commit 94ca815

Browse files
committed
refactor:examples add tips
1 parent c27b239 commit 94ca815

File tree

4 files changed

+52
-40
lines changed

4 files changed

+52
-40
lines changed

packages/core/public/image.png

-86.8 KB
Binary file not shown.

packages/core/src/components/web/Tips.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class Tips extends BaseThree {
2828
this.cssRenderer.setSize(this.sizes?.width, this.sizes.height);
2929
this.domElement = this.cssRenderer.domElement;
3030
this.domElement.style.position = 'absolute';
31-
this.domElement.style.zIndex = '9999';
31+
this.domElement.style.zIndex = '2';
3232
this.domElement.style.top = '0px'
3333
this.domElement.style.left = '0px'
3434
this.domElement.style.pointerEvents = 'none';

packages/examples/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
</head>
1515
<body>
1616
<div id="app">
17+
<div class="chart">6666</div>
1718
<canvas class="webgl" id="_scene"></canvas>
1819
</div>
1920
<script type="module" src="./src/SmartCommunity.ts">
@@ -31,5 +32,14 @@
3132
height: 100vh;
3233
overflow: hidden;
3334
}
35+
.chart {
36+
position: absolute;
37+
top: 0;
38+
padding: 20px;
39+
left: 50%;
40+
font-size: 60px;
41+
z-index: 3;
42+
color: #fff;
43+
}
3444
</style>
3545
</html>

packages/examples/src/SmartCommunity.ts

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const instance = new AUTO.ThreeAuto(undefined, {
3939
{
4040
name: "preview",
4141
type: "GLTF",
42-
path: "./models/preview_opt.glb",
42+
path: "./models/community.glb",
4343
show: true,
4444
},
4545
{
@@ -48,43 +48,43 @@ const instance = new AUTO.ThreeAuto(undefined, {
4848
path: '/env/artist_workshop_1k.f6da9025.hdr'
4949
}
5050
],
51-
shadow: {
52-
show: true,
53-
width: 1600,
54-
height: 1600,
55-
color: '#000',
56-
opacity: 0.3,
57-
position: { x: 0, y: 0.1, z: 0 },
58-
rotation: { x: -Math.PI / 2, y: 0, z: 0 },
59-
},
60-
light: [
61-
{
62-
type: "directional",
63-
color: "#fff",
64-
intensity: 1,
65-
distance: 500,
66-
helper: false,
67-
helperSize: 5,
68-
lightName: "spot-light",
69-
castShadow: true,
70-
shadow: {
71-
mapSizeWidth: 1024,
72-
mapSizeHeight: 1024,
73-
cameraLeft: -500,
74-
cameraTop: 500,
75-
cameraBottom: -500,
76-
cameraRight: 500,
77-
cameraNear: 0.1,
78-
cameraFar: 500,
79-
radius: 100,
80-
bias: -0.004,
81-
normalBias: 0.027
82-
},
83-
position: {
84-
x: -100, y: 300, z: 165,
85-
}
86-
},
87-
],
51+
// shadow: {
52+
// show: true,
53+
// width: 1600,
54+
// height: 1600,
55+
// color: '#000',
56+
// opacity: 0.3,
57+
// position: { x: 0, y: 0.1, z: 0 },
58+
// rotation: { x: -Math.PI / 2, y: 0, z: 0 },
59+
// },
60+
// light: [
61+
// {
62+
// type: "directional",
63+
// color: "#fff",
64+
// intensity: 1,
65+
// distance: 500,
66+
// helper: false,
67+
// helperSize: 5,
68+
// lightName: "spot-light",
69+
// castShadow: true,
70+
// shadow: {
71+
// mapSizeWidth: 1024,
72+
// mapSizeHeight: 1024,
73+
// cameraLeft: -500,
74+
// cameraTop: 500,
75+
// cameraBottom: -500,
76+
// cameraRight: 500,
77+
// cameraNear: 0.1,
78+
// cameraFar: 500,
79+
// radius: 100,
80+
// bias: -0.004,
81+
// normalBias: 0.027
82+
// },
83+
// position: {
84+
// x: -100, y: 300, z: 165,
85+
// }
86+
// },
87+
// ],
8888
});
8989

9090
const checkMeshShadow = (origin: any) => {
@@ -103,14 +103,16 @@ instance.resource?.on('ready', () => {
103103
// preview.scene.position.y = -100
104104
preview.scene.position.z = 120
105105
preview.scene.children.forEach((item: any) => {
106-
console.log(item);
106+
// console.log(item);
107107
item.castShadow = true
108108
checkMeshShadow(item.children)
109109
})
110110
instance.scene.add(preview.scene)
111111
const env = instance.resource?.items.get('env')
112112
env.mapping = THREE.EquirectangularReflectionMapping
113113
instance.scene.environment = env
114+
console.log(instance._renderer,33333);
115+
114116
})
115117

116118
const liftDetail = [

0 commit comments

Comments
 (0)