2017-01-23 7 views
1

画像を変更するにはどのようなJavaScriptが必要ですか?私はそれらをターゲットにする方法を考え出すことはできません。A-フレーム:JavaScriptを使用して画像を変更する方法

<a-scene stats> 
<a-sky src="../1/img/2.jpg"></a-sky> 
    <a-assets> 
    <img id="my-image" src="../1/img/bear.png" > 
    <img id="bear2" src="../1/img/bear.png" > 
    <img id="bear3" src="../1/img/bear.png" > 
    </a-assets> 
    <!-- Using the asset management system. --> 
    <a-image src="#my-image" width="10" height="10" position="-5 1 -7" rotation="0 10 0"></a-image> 
    <a-image src="#bear2" width="10" height="10" position="5 1 -5" rotation="0 -60 0"></a-image> 
    <a-image src="#bear3" width="150" height="150" position="-45 2 100"></a-image> 
    <!-- Defining the URL inline. Not recommended but more comfortable for web developers.--> 
+0

あなたはこの質問に「画像」とはどういう意味ですか?あなたのサンプルコードからは、 '.obj'ジオメトリファイルと' .mtl'マテリアルライブラリファイルだけを扱っているようです。 – cuervoo

+0

画像を変更するとどういう意味ですか?イメージを別のイメージに置き換える? –

+0

どの画像を変更しますか? これは、次のような単純な意味があります。 document.getElementById( "my-imge")。src = "/images/some-image.png"; – Kickass

答えて

関連する問題