Giter Club home page Giter Club logo

Comments (3)

frenchtoast747 avatar frenchtoast747 commented on June 2, 2024

I pasted the following into requirebin and it worked:

const OBJ = require('webgl-obj-loader');


// chaining promise approach
OBJ.downloadModels([{
  obj: 'http://frenchtoast747.github.io/webgl-obj-loader/models/suzanne.obj',
  mtl: true 
}])
.then((data) => console.log("success:", data))
.catch((e) => console.error("Failure:", e));

// resolved/rejected in the same `.then()`
OBJ.downloadModels([{
  obj: 'http://frenchtoast747.github.io/webgl-obj-loader/models/suzanne.obj',
  mtl: true 
}])
.then(
  function(data) { console.log("success:", data) }, 
  function(e) { console.error("Failure:", e) }
); 

In the console:
image

I apologize, I'd link to a working snippet, but RequireBin is not letting me save the snippet at the moment.

I would expect you to see something in the console with the code you've pasted above. The only thing that looks odd to me is the URL model/test.obj, you may want to use absolute paths instead.

from webgl-obj-loader.

ClaudioPaterniti avatar ClaudioPaterniti commented on June 2, 2024

I was using the minimized version webgl-obj-loader.min.js and could not make it work, I tried with the full version and it actually printed success with the same code I was using before. I don't know much about javascript but I guess there is something wrong with the minimization, maybe some name conflict.

from webgl-obj-loader.

frenchtoast747 avatar frenchtoast747 commented on June 2, 2024

Thanks for the details! I will look into this more.

from webgl-obj-loader.

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.