How do I import .obj or other models files into p5.js

1.9k views Asked by At

So What I want is an .OBJ file in my plane Sim that is the main simulator(The plane), I make a small cube to test if it will work, and when I try to insert the file. It does not give me an option to load it. I first tried this when looking at TheCodingTrain's tutorial, in the tutorial, when adding a new file, there was a Dropbox where he could insert the file he wanted, but I use the standard p5.js web editor format and it does not give me the option or Dropbox, and when I type the name of the file, It tells me that It does not except the .OBJ file type.

2

There are 2 answers

0
Paul Wheeler On

It's difficult to understand your question since you don't link to the CodingTrain tutorial in question and the references to "Dropbox" (a totally separate service that you could use to host files, but not necessarily load them in a p5.js sketch) are very confusing.

However, uploading files and loading 3d models in the p5js web editor is quite straightforward:

  1. Expand the "Sketch files" panel Button to expand "Sketch files" panel
  2. Click the down arrow menu in the top right of the "Sketch files" panel
  3. Select the "Upload file" option File option menu -> Upload file
  4. Either Drag and Drop your .obj file or click to open the file browser and select it. File upload dialog

Here's an example

1
KitchenSpice On

Ok, now I know why this was not happening, it seems that I was not logged in when I am uploading my files, I always log in only to save my projects before my classes end.