supermedium / aframe-react

:atom: Build virtual reality experiences with A-Frame and React.
https://ngokevin.github.io/aframe-react-boilerplate/
MIT License
1.42k stars 151 forks source link

a-collada-model - model does not appear #87

Closed anton6 closed 7 years ago

anton6 commented 7 years ago

I'm trying to run the "Anime UI" example from aframe on aframe-react, but I'm unable to load engine.dae. It just does not appear.

My Scene contains the following code:

<a-assets>
  <a-asset-item id="engine" src="models/engine.dae" />
</a-assets>

<Entity primitive="a-entity" position="1.75 0 1.2" rotation="0 28 0">
  <Entity primitive="a-camera" near="0.1" user-height="0" />
</Entity>

<Entity primitive="a-entity" position="0 0 -3">
  <Entity primitive="a-collada-model" src="#engine" rotation="90 0 0" scale="18 18 18" />
</Entity>

Can anyone please tell me what I'm doing wrong and why the model is not appearing.

Thanks!

ngokevin commented 7 years ago

Does <Entity collada-model={{src: '#engine'}} rotation="90 0 0" scale="18 18 18"/> work?

anton6 commented 7 years ago

Sorry still did not work.

This is my project structure right now:

screen shot 2017-05-19 at 00 13 33

This is what a-collada-model looks like when I inspect it:

screen shot 2017-05-19 at 00 08 43

And when I run the example on aframe I get this:

screen shot 2017-05-19 at 00 11 09
ngokevin commented 7 years ago

Does the model load OK in Network Inspector? 200, 404? Errors?

anton6 commented 7 years ago

Yes the model seems to load OK, 200.

Although, the model appears to load twice for some reason.

This is the log and network tab when page loads:

screen shot 2017-05-19 at 00 33 16 screen shot 2017-05-19 at 00 36 09
ngokevin commented 7 years ago

Hmm, can you inspect what the engine.dae response is? That nodes parse error seems to be it, makes it sound like it got something weird in return,

anton6 commented 7 years ago

Yes, I think you are absolutely correct. The response does not look right.

This is the response:

screen shot 2017-05-19 at 00 54 14

Any idea why this might be?

ngokevin commented 7 years ago

Hm, maybe something to do with the dev server? If you open the file, it looks correct, right?

anton6 commented 7 years ago

Ye, the file looks okay and comes up as expected in the preview window. I copied it over directly from the aframe example.

screen shot 2017-05-19 at 01 55 24

By the way I'm using the aframe-react-boilerplate for this. I simply did npm i and then npm start.

Did I have to configure anything else in the boilerplate for this example to work?

ngokevin commented 7 years ago

Try moving the model folder relative to the index.html file?

anton6 commented 7 years ago

Thanks for pointing me in the right direction. Turns out I just had to put the models folder into public folder.

Ethan-liao commented 7 years ago

This post just save me. Had the same issue.