Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
333 views
in Technique[技术] by (71.8m points)

javascript - 如何在A帧中设置模型的大小?(How to set the size of the model in A-frame?)

There are 3 different models that appear on the a frame page, but all have the same size.

(框架页面上显示3种不同的型号,但是尺寸都相同。)

How to register that different model had different size?

(如何注册具有不同尺寸的不同型号?)

 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) 

  ask by NikPo translate from so


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I recommend checking the docs on how to modify a component .

(我建议检查有关如何修改组件文档 。)

The provided syntax looks incorrect it should look something like this:

(提供的语法看起来不正确,应该看起来像这样:)

  entityEl.setAttribute('scale', {x: 10, y: 20, z: 10});

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...