框架页面上会显示3种不同的型号,但是尺寸都相同。如何注册具有不同尺寸的不同型号?
AFRAME.registerComponent('model-obj'
Forest.attrebute( scale 10 20 10)
<a-obj-model id="obj_model" position="-55 0 -40" rotation="0 90 0" scale="5 10 5" src="#{{ object.terrain}}"
mtl="#{{ object.terrain }}-mtl"></a-obj-model>
<a-obj-model class="obj_model" id="city-scape" position="-5 0 -40" rotation="0 90 0" scale="5 10 5" src="#{{ object.terrain}}"
mtl="#{{ object.terrain }}-mtl"></a-obj-model>
<a-obj-model class="obj_model" id="city-scape-right" position="50 0 -40" rotation="0 90 0"
src="#{{ object.terrain}}" mtl="#{{ object.terrain }}-mtl"></a-obj-model>
AFRAME.registerComponent('model-obj'
Forest.attrebute( scale 10 20 10)
答案 0 :(得分:0)
我建议检查docs on how to modify a component。提供的语法看起来不正确,应该看起来像这样:
entityEl.setAttribute('scale', {x: 10, y: 20, z: 10});