Now the JSONLoader had been removed, how could I load the models that loaded by JSONLoader before?
Yes, JSONLoader was removed from three.js with R99. But the loader is still available as LegacyJSONLoader. If you include the file into your project, you can create an instance of LegacyJSONLoader and load your JSON model as before.
Keep in mind that you are using an obsolete JSON format. You might want to consider to export your models to glTF via GLTFExporter in order to use a future-proof 3D format. The following example demonstrates the usage of the mentioned exporter:
https://threejs.org/examples/misc_exporter_gltf.html
ObjectLoader is available and it works as JSONLoader
Related
Very new to coding and Im following a course on three.js using cannon-es, I have quickly come to understand the need to keep things organized in classes using constructor, (my project is currently all in one or two files and is getting messy.) But still confused as to how to convert existing code into a class. I would like to see an example of basic cannon physics setup as a class or how I can make one.
I was in the same situation and was able to make parts as classes but seems buggy as when I add new objects to the Cannon world,the objects before disappear,don't know what causes this but I can share my code with you so we can solve this issue if you are willing.
I'm trying to make huggingface's transformer library use a model that I have downloaded that is not in the huggingface model repository.
Where does transformers look for models? Is there an equivalent of the $PATH environment variable for transformers models?
Research
This hugging face issues talks about manually downloading models.
This issue suggests that you can work around the question of where huggingface is looking for models by using the path as an argument to from_pretrained (#model = BertModel.from_pretrained('path/to/your/directory')`)
Related questions
Where does hugging face's transformers save models?
Is it possible that 3js modify uuid of objects behind the scene? I thought that uuid is constant and only it may be changed manualy by developer.
Please read the docs first, https://threejs.org/docs/#api/en/core/Object3D.id. It clearly says it is read-only.
We have followed the step-by-step tutorials for the model-derivative apis. I can use the /manifest endpoint to get the object tree. I can also create tasks to get a .obj file with geometries of some objects. There is no way to know which geometry belongs to which object.
I could potentially create a job for each object, but that would require thousands of jobs per model which seems excessively inefficient. Are we missing something? Any pointers on how to get geometry for objects while retaining the mapping between them?
The Viewer will extract the information, but as of today, we don't have a documentation for SVF, so it may get trickier to analyze the geometry from this file. You may use JavaScript, something like described in this sample or this sample.
You can extract the OBJs for each element, but may need a big number of jobs. In this case, you need to run your code for .obj files.
It is interesting that all examples using Collada loader loads have one model. I am having trouble loading multiple. I have tried the following
1) Create one loader and just try to load all models using it without waiting for previous
one to finish. This failed it looked like i got mixture of models in my models
2) Create one loader and wait for each model to load before loading next. This failed
but I am not sure if I am doing something wrong.
3) Create a different Loader for each model. This works but it seems a waster.
My question is how is three.js Collada Loader designed to handle multiple models?