Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -290,10 +290,10 @@ def generate_tilemap(files, dirpath, gw=8, gh=8):
|
|
290 |
model_counts = {f: 0 for f in models} # Track spawned model counts ๐
|
291 |
if vids:
|
292 |
v = vids[0]; s = Path(v).stem
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
entities += (f'<a-video src="#{s}" width="{videoWidth}" height="{videoHeight}" '
|
298 |
f'rotation="-90 0 0" position="0 0.05 0" '
|
299 |
'material="shader:flat; src:#{s}" loop="true" autoplay="true"></a-video>')
|
@@ -339,7 +339,7 @@ def main():
|
|
339 |
# ๐ 5.2 File Uploader: Drop your media treasures here! ๐
|
340 |
st.markdown("### โ Add Media Files")
|
341 |
ups = st.file_uploader(
|
342 |
-
"
|
343 |
accept_multiple_files=True
|
344 |
)
|
345 |
st.markdown("### ๐ Uploaded Model Files")
|
|
|
290 |
model_counts = {f: 0 for f in models} # Track spawned model counts ๐
|
291 |
if vids:
|
292 |
v = vids[0]; s = Path(v).stem
|
293 |
+
# ๐น Adjust video dimensions to cover the tilemap while preserving aspect ratio ๐ฅ
|
294 |
+
# Assume a common video aspect ratio (16:9) and scale to fit 8x8 tilemap
|
295 |
+
videoWidth = 8 # Match tilemap width
|
296 |
+
videoHeight = 8 # Match tilemap height (square to fit tilemap)
|
297 |
entities += (f'<a-video src="#{s}" width="{videoWidth}" height="{videoHeight}" '
|
298 |
f'rotation="-90 0 0" position="0 0.05 0" '
|
299 |
'material="shader:flat; src:#{s}" loop="true" autoplay="true"></a-video>')
|
|
|
339 |
# ๐ 5.2 File Uploader: Drop your media treasures here! ๐
|
340 |
st.markdown("### โ Add Media Files")
|
341 |
ups = st.file_uploader(
|
342 |
+
"๐ผ๏ธ png/jpeg, ๐ฐ obj/glb/gltf, ๐น mp4:",
|
343 |
accept_multiple_files=True
|
344 |
)
|
345 |
st.markdown("### ๐ Uploaded Model Files")
|