如何参考<!-图像。 ->是否来自Python变量?

时间:2019-10-30 17:02:33

标签: html django

有一个Python {{object variable.background}},它从数据库输出选定的背景。当颜色的背景(“#c6aa99”,“#E1A600”)正确显示场景时,但是将变量设置为图像值“火星”时,“星号”不会在如何将变量的值赋给“ star”,“ wars”,以将图片上传到场景?

<a-scene id="aframe" foo >

      <a-assets>
         <!-- Images. -->
        <img id="star" src="https://ucarecdn.com/30d7b1e6-2867-4396-a64d-8fb41e69ce0d/">
        <img id="city" src="https://cdn.aframe.io/360-image-gallery-boilerplate/img/city.jpg">
        <img id="cosmos" src="https://ucarecdn.com/34a5bbdb-1820-44c3-a848-26acd9356bbe/">
        <img id="sechelt" src="https://ucarecdn.com/40714251-095c-407e-9b5f-76f361db3b78/">
        <img id="blank" src="https://ucarecdn.com/fc2d2aa9-08b0-4d05-931c-85b78130d758/">
        <img id="mars" src="https://ucarecdn.com/4496c535-1b3d-4c1c-a24f-8fa6bcfb895a/">
        <img id="dey" src="https://ucarecdn.com/1bbbf75b-cc02-450a-91af-e528a6eaf8a1/">
        <img id="blue" src="https://c1.staticflickr.com/3/2929/33929340355_1fb4ecf6e0_k.jpg">
        <img id="wasteland" src="https://c1.staticflickr.com/5/4556/24549684008_5b18834af3_o.png">
      </a-assets>



      <!-- General Enviornment -->
	   <!-- Background selected when creating a new scene (taken from the database ) -->

      <a-sky id="sky" color="{{ object.background }}"></a-sky>

      <a-light type="ambient" intensity=".5" color="#FF54CA"></a-light>
{% endblock %}

	      <!-- Text written by the user when creating a new scene (taken from the database) -->
	 
    <a-plane id="ground" position="0 0 0" rotation="-90 0 0" width="100" height="100" color="#00FF00" material="roughness: 1;"></a-plane>


    


     

      
      </a-entity>

    </a-scene>

0 个答案:

没有答案