Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
TOTAL = 0
|
4 |
+
|
5 |
+
with gr.Blocks() as demo:
|
6 |
+
gr.Markdown("Nice 3D View")
|
7 |
+
t = gr.Timer(value=2.0)
|
8 |
+
m = gr.Model3D(value='box.obj', label='3D', height=500, interactive=False, clear_color=[0.0, 0.0, 0.0, 0.0])
|
9 |
+
|
10 |
+
@t.tick(inputs=[t], outputs=[m])
|
11 |
+
def update_geometry(x):
|
12 |
+
global TOTAL
|
13 |
+
TOTAL += 10
|
14 |
+
camera_position = (TOTAL, 45, 1)
|
15 |
+
print(camera_position)
|
16 |
+
return gr.Model3D(camera_position=camera_position)
|
17 |
+
|
18 |
+
|
19 |
+
demo.launch()
|