Closed Kabaril closed 1 month ago
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!
I agree this feature makes sense! Although I would follow the precedent set by shaders, where loadShader
is called in preload
and loads from a file, and createShader
is called in setup and loads from a string. That would imply that we'd have loadModel
from a file and createModel
from a string.
I'd like to try and work on this.
@davepagurek I implemented the method to load obj/stl from a string, but wonder if this is still up for debate and I was a little premature. Should I make the pr?
Feel free to make a PR, thanks!
Increasing access
Most appropriate sub-area of p5.js?
Feature enhancement details
The current loadModel function takes a path to load a model from a .stl or .obj file, however this requires that a server exists that serves these assets.
A function that loads models directly from a string can increase portability of examples (as in copy + paste) and allows loading models without a server.
The following example:
could also be written as:
The changes in code should be trivial, as this can reuse already existing helper functions.