Reputation: 13233
I have a COLLADA, OBJ/MTL, etc model in A-Frame with <a-collada-model>
or <a-obj-model>
.
When I add it to the scene, I don't see anything. What is going on?
Upvotes: 1
Views: 3450
Reputation: 13233
Use a Webserver:
Make sure you are using a local webserver or hosted webserver with CORS with correct mime types. Rather than trying to use filesystem.
Check for CORS:
If you are loading the asset from a different domain, you will need cross-origin resource sharing (CORS) headers set on the asset.
For some options, all resources hosted on GitHub Pages are served with CORS headers. We highly recommend GitHub Pages as a simple deployment platform.
Alternatively, you could also upload assets using the A-Frame + Uploadcare Uploader, a service that will help serve our assets CORS’d. (currently not working).
A catch to this is for OBJ, only the latest builds of A-Frame leading up to 0.3.0 enabled cross-origin on the MTLLoader, so that may or may not work until 0.3.0. Unsure.
Check the Scale:
The scale of models are often very, very large in comparison to the camera. They might be 1000 times bigger than the user such that the user is inside the model and cannot see it. Try scaling it down scale=".001 .001 .001"
and see where it is.
The A-Frame Inspector shipping with 0.3.0 will help tremendously with this. When that comes out, press ctrl+shift+i to open it.
If textures missing, check your paths:
You can usually tell if you are getting 404 on images. If using a model with separate material file such as MTL, they often refer to image textures via relative paths. Make sure that the images are in the right expected location in relation to the MTL file by reading through the MTL file for image paths. And also make sure they have the right name.
If rendering as black, convert textures to use images:
Why does my OBJ / MTL model material show up as black?
Upvotes: 3