awacke1 commited on
Commit
1ad4ab4
ยท
verified ยท
1 Parent(s): badfc89

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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
- // ๐Ÿ“น 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
- const videoWidth = 8; // Match tilemap width
296
- const 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,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
- "Add files (๐Ÿ–ผ๏ธ png/jpeg, ๐Ÿฐ obj/glb/gltf, ๐Ÿ“น mp4, etc.):",
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")