2012-11-03 24 views

回答

2

你可以包裹內聯在變換,那麼你可以通過改變變換的比例改變內嵌的大小。

例如:http://jsfiddle.net/wildpeaks/ZZfb2/2/


<X3D width="400px" height="300px" showStat="true"> 
    <Scene> 
     <Transform id="redBox"> 
      <Inline url="http://x3dom.org/x3dom/example/scene/redBox.x3d" /> 
     </Transform> 
    </Scene> 
</X3D> 

<button onclick="change_size()">Click to change the size</button> 

function change_size() { 
    document.getElementById('redBox').setAttribute('scale', '3 0.5 1'); 
}​ 
+0

這設定對象的比例,而不是其尺寸。當您這樣做時: 您的結果相同。但謝謝你的嘗試。 – user1796705

相關問題