xinjie.wang
commited on
Commit
·
69cbe68
1
Parent(s):
d614a76
Add application file
Browse files
app.py
CHANGED
@@ -9,6 +9,25 @@ def greet(n):
|
|
9 |
|
10 |
|
11 |
with gr.Blocks() as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
model3d = LitModel3D(label="MESH", exposure=10, height=300)
|
13 |
|
14 |
|
|
|
9 |
|
10 |
|
11 |
with gr.Blocks() as demo:
|
12 |
+
|
13 |
+
demo.load(
|
14 |
+
_js="""
|
15 |
+
() => {
|
16 |
+
const viewer = document.querySelector('.gr-model3d').viewer;
|
17 |
+
const scene = viewer.scene;
|
18 |
+
|
19 |
+
// 添加环境光
|
20 |
+
const ambientLight = new THREE.AmbientLight(0xffffff, 1.5);
|
21 |
+
scene.add(ambientLight);
|
22 |
+
|
23 |
+
// 添加方向光
|
24 |
+
const directionalLight = new THREE.DirectionalLight(0xffffff, 1.5);
|
25 |
+
directionalLight.position.set(5, 5, 5);
|
26 |
+
scene.add(directionalLight);
|
27 |
+
}
|
28 |
+
"""
|
29 |
+
)
|
30 |
+
|
31 |
model3d = LitModel3D(label="MESH", exposure=10, height=300)
|
32 |
|
33 |
|