Giter Club home page Giter Club logo

Comments (7)

WoodNeck avatar WoodNeck commented on May 22, 2024 1

@devhims
Hmm, in that case I assume that file is not loaded as a static file but in the format of a HTML page.
Check what it shows on the ./assets/specstand.glb page and if it shows a HTML page, fix the config to serve static files on the assets folder.
In other way, moving the 3D model to the public folder will work I think.

from egjs-view3d.

WoodNeck avatar WoodNeck commented on May 22, 2024 1

@devhims
I'm glad to hear that 👍
Don't worry about filing more issues. I may be slow to respond if I'm working on other things, but I'll check yours soon as I can :)

from egjs-view3d.

WoodNeck avatar WoodNeck commented on May 22, 2024

Hello @devhims!
By the error message, I guess there's something wrong with your 3D model.
.glb file usually starts with the word "glTF" and followed by the glTF file's contents which basically has the same format as JSON.

image

Sample glb model

So I guess you should check your 3D model's validity first, or if you can share your model I can check that for you :)

There's a useful site to test your GLTF/GLB model here

from egjs-view3d.

devhims avatar devhims commented on May 22, 2024

Thanks for the response @WoodNeck! Actually, there is no issue with the model file. I had to first import the model in the js file and then use it.

import spec from './assets/specstand.glb';

then I used spec as an argument in the load method. While this technique works for .glb models, it didn't work for .gltf files. If you've any suggestions that would be awesome!! :)

from egjs-view3d.

devhims avatar devhims commented on May 22, 2024

@WoodNeck can you please share a link that explains how to update the config. As for moving the files to the public folder, react by default doesn't allow us to import assets from outside src directory.

UPDATE: Moving the files to the public folder and adjusting the relative path gets the issue resolved.

from egjs-view3d.

WoodNeck avatar WoodNeck commented on May 22, 2024

@devhims
I hope this helps :)
https://create-react-app.dev/docs/using-the-public-folder/
See the process.env.PUBLIC_URL section

from egjs-view3d.

devhims avatar devhims commented on May 22, 2024

Thanks a bunch @WoodNeck! You're AWESOME!!
I'll most likely run into more issues as I continue to work on the library. I hope you don't mind me raising more issues. 😄

from egjs-view3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.