How to add a img texture to <a-box>? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to add a img texture to <a-box>?

I have the code below: https://codepen.io/AlexTAG/pen/ExoReZa?editors=1010 in a tutorial, i saw that i have to add the img source inside a a-asset, like i did in html line 21-22-23. To use said image as a texture for a-box, for example, I saw i have to add inside the tag "src=image_id", like i did in html line 9. The texture doesn't apply for some reason, maybe the image is not used correctly? I don't know how to fix it.

11th Apr 2022, 11:16 AM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
2 Answers
+ 2
Interesting subject WebVR. I see you're using A-frame. You may try their communities if you're stuck. They have a documentation a discord and even a slack Channel. Try your luck there. :D https://aframe.io/community/
14th Apr 2022, 8:32 AM
Chris Coder
Chris Coder - avatar
+ 2
Hey, from what i ve read on the internet, the solution seems to be to have the images in the same place as the code. If i place them in the same folder, the texture is applied, but if, for example I use a img(link) from imgur, it doesn't work(it probably has to do with CORS) Thanks for thr link :D
14th Apr 2022, 8:35 AM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar