point to textures

This commit is contained in:
tresabhi committed 2026-06-08 20:24:51 -05:00
1 parent c86b269cf2
commit f790d07ed6
2 files changed
+12 -9

No files matched your search

+1 -1
View File
@@ -81,7 +81,7 @@ public class MonoGltf
{ {
var texture = parameterTexture.Value; var texture = parameterTexture.Value;
var name = Path.GetFileNameWithoutExtension(texture.GetPathName()); var name = Path.GetFileNameWithoutExtension(texture.GetPathName());
var path = $"textures/{name}.webp"; var path = $"../../textures/{name}.webp";
materialBuilder.WithChannelImage(channel, stubTexture); materialBuilder.WithChannelImage(channel, stubTexture);
materialBuilder.GetChannel(channel).Texture.PrimaryImage.Name = path; materialBuilder.GetChannel(channel).Texture.PrimaryImage.Name = path;
@@ -1,5 +1,5 @@
import { OrbitControls } from "@react-three/drei"; import { OrbitControls } from "@react-three/drei";
import { useLoader } from "@react-three/fiber"; import { Canvas, useLoader } from "@react-three/fiber";
import { GLTFLoader } from "three-stdlib"; import { GLTFLoader } from "three-stdlib";
import styles from "./index.module.css"; import styles from "./index.module.css";
@@ -7,21 +7,24 @@ export function TankopediaSandbox() {
return ( return (
<div className={styles.wrapper}> <div className={styles.wrapper}>
<div className={styles.sandbox}> <div className={styles.sandbox}>
{/*<Canvas <Canvas
scene={{ fog: new FogExp2("black", 0.05) }} // scene={{ fog: new FogExp2("black", 0.05) }}
shadows shadows
className={styles.canvas} className={styles.canvas}
frameloop="demand" frameloop="demand"
> >
{!import.meta.env.SSR && <Content />} {!import.meta.env.SSR && <Content />}
</Canvas>*/} </Canvas>
</div> </div>
</div> </div>
); );
} }
function Content() { function Content() {
const gltf = useLoader(GLTFLoader, "/amogos.glb"); const gltf = useLoader(
GLTFLoader,
"/models/tanks/TankEntity.A128_Concept_1b/hull.glb",
);
gltf.scene.traverse((child) => { gltf.scene.traverse((child) => {
child.castShadow = true; child.castShadow = true;
@@ -29,12 +32,12 @@ function Content() {
return ( return (
<> <>
<group scale={4}> <group>
<primitive object={gltf.scene} /> <primitive object={gltf.scene} />
</group> </group>
<ambientLight /> <pointLight castShadow position={[3, 10, 5]} intensity={2 ** 14} />
<pointLight castShadow position={[3, 10, 5]} intensity={1000} /> <ambientLight intensity={1} />
<mesh receiveShadow position={[0, -1, 0]} rotation={[-Math.PI / 2, 0, 0]}> <mesh receiveShadow position={[0, -1, 0]} rotation={[-Math.PI / 2, 0, 0]}>
<planeGeometry args={[2 ** 8, 2 ** 8]} /> <planeGeometry args={[2 ** 8, 2 ** 8]} />