From 22cd57c55c5b972e14488f8912d90ef36bed3d65 Mon Sep 17 00:00:00 2001 From: Alejandro Rosales Date: Fri, 14 Mar 2025 09:42:15 -0600 Subject: [PATCH] Sin comentarios --- src/pages/Previewer.tsx | 63 ++++------------------------------------- 1 file changed, 6 insertions(+), 57 deletions(-) diff --git a/src/pages/Previewer.tsx b/src/pages/Previewer.tsx index 8a3562d..a75f671 100644 --- a/src/pages/Previewer.tsx +++ b/src/pages/Previewer.tsx @@ -2,9 +2,9 @@ import type { OrbitControls as OrbitControlsImpl } from 'three-stdlib'; import { Canvas } from "@react-three/fiber"; -import { useGLTF, useAnimations, Environment, Loader, OrbitControls, Html, Bounds } from "@react-three/drei"; +import { useGLTF, useAnimations, Environment, Loader, OrbitControls, Bounds } from "@react-three/drei"; import { Suspense, useEffect, useRef, useState } from "react"; -import { RotateCw, Play, Pause, Film, ListTree, Shrink, Expand } from "lucide-react"; +import { RotateCw, Play, Pause, Film, Shrink, Expand } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Popover, @@ -42,26 +42,14 @@ function Model({ url, onAnimationsLoaded, onNodesLoaded }: { }, [actions, animations, onAnimationsLoaded, onNodesLoaded]); return ( - <> - - {/* find the object in the perfect angle */} + + {/* find the object in the perfect angle */} - - - {/* {scene.children.map((node, index) => ( - -
- {node.name} -
- - ))} */} - + +
); } -// Preload the model -// useGLTF.preload("/3d/motor_de_combustion/scene.gltf"); -// Main 3D Viewer export default function Previewer({ modelUrl }: { modelUrl: string }) { const controlsRef = useRef(null); const containerRef = useRef(null); @@ -77,13 +65,6 @@ export default function Previewer({ modelUrl }: { modelUrl: string }) { nodePositions; - -/* const resetView = () => { - if (controlsRef.current) { - controlsRef.current.reset(); - } - }; */ - const playAnimation = (name: string) => { if (actions[name]) { Object.values(actions).forEach(action => action.stop()); // Stop other animations @@ -116,7 +97,6 @@ export default function Previewer({ modelUrl }: { modelUrl: string }) { } }; - return (
@@ -153,37 +133,8 @@ export default function Previewer({ modelUrl }: { modelUrl: string }) { - - {/* - - - Partes del modelo - - - -
- {nodes.length > 0 ? ( - nodes.map((node, index) => ( -
- {node} -
- )) - ) : ( -

Este modelo no tiene partes.

- )} -
-
-
-
*/}
- {/* */} - - {/* Botón de pantalla completa */}