Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model Loads but not shown #283

Open
adem-enes opened this issue Jan 7, 2025 · 0 comments
Open

Model Loads but not shown #283

adem-enes opened this issue Jan 7, 2025 · 0 comments

Comments

@adem-enes
Copy link

adem-enes commented Jan 7, 2025

Issue: One GLTF Model Not Rendering in React Project

Description

I'm using React with TypeScript (created using Vite) and the following dependencies:

{
  "@react-three/drei": "^9.120.5",
  "@react-three/fiber": "^8.17.10",
  "react": "^18.2.0",
  "react-dom": "^18.2.0",
  "three": "^0.172.0"
}

For my project, I have two 3D models. Both of them were converted from .obj to .gltf, and I used gltfjsx with the -t flag to convert them into React components.

One of the models renders and displays perfectly on gltf.pmnd.rs. However, when I load it into my React project, it does not render.

I tested both the models using the useLoader hook. All of them are loaded successfully and can be logged in the console, except for this specific model, which fails to display.

Steps to Reproduce

  1. Clone the repository: adem-enes/r3f-test
  2. npm i && npm run dev
  3. You'll see two buttons on top left corner named 1 and 2. 1 for working model and 2 for problematic model

Additional Information

  • No errors or warnings appear in the browser console.
  • The problematic model has no textures, only plain grey color, similar to the other models.
  • File size comparison:
    • Non-working model: ~1.6 MB
    • Working converted model: ~6.1 MB
  • I tested loading the problematic model in isolation, but the issue persists.
  • No transformations, shaders, or custom logic are applied to the models.

Expected Behavior

The problematic GLTF model should render correctly in the React project, as it does on gltf.pmnd.rs.

Actual Behavior

The model does not render in the React project, despite being successfully loaded and logged in the console.


Let me know if you'd like further revisions!

@CodyJasonBennett CodyJasonBennett transferred this issue from pmndrs/react-three-fiber Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant