Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140734

Change the color of an object (.dae or gltf) in "AR.JS"

$
0
0

Please, I'm trying to change the color of an object I created in blender. I can change the color of objects like "a-box, a-sphere" in the html code itself, but with objects inside tree.js (gltf or .dae - collada) not.

https://codepen.io/kurtrodrigues/pen/qBBXdvY (PS. This is just a test environment for future application in my real project (AR.JS))

<html>
<head>
    <script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
</head>

     <body>
         <a-scene>

             <a-gltf-model id ="test" src="https://raw.githubusercontent.com/KurtRodrigues/KurtRodrigues.github.io/master/Arquivos%20utilizados/Pe%C3%A7a%2Bbancada_V2.gltf" color= "#FF0000" position = "0 0 -3" rotation="0 0 0" scale="1.5 1.5 1.5" size="20px"> </a-gltf-model>

             <a-sky color="#ECECEC"></a-sky>
         </a-scene>
      </body>
</html>

Already tried in

html with "color= # ff00000",

in css by id ".test {color: # ff0000}

and js"

var b = document.querySelector ("test"); b.setAttribute ("color", "red");

Is there any way to change the color of the object directly in the code or just at the moment I made the object (blender)? Thanks and sorry for the english.


Viewing all articles
Browse latest Browse all 140734

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>