| import gradio as gr | |
| TOTAL = 0 | |
| with gr.Blocks() as demo: | |
| gr.Markdown("Nice 3D View") | |
| t = gr.Timer(value=2.0) | |
| m = gr.Model3D(value='Duck.glb', label='3D', height=500, interactive=False, clear_color=[0.0, 0.0, 0.0, 0.0]) | |
| def update_geometry(x): | |
| global TOTAL | |
| TOTAL += 10 | |
| camera_position = (TOTAL, 45, 1) | |
| print(camera_position) | |
| return gr.Model3D(camera_position=camera_position) | |
| demo.launch() |