【问题标题】:how do interact children object in cube object - three.js如何在多维数据集对象中交互子对象 - three.js
【发布时间】:2013-05-27 23:48:34
【问题描述】:

我有一个主要的立方体对象wireFrame:

var cubeGeometry = new THREE.CubeGeometry( 50, 50, 50 );

还有一些立方体不是线框:

var cubeTemp = new THREE.CubeGeometry( 10, 10, 10 );

我想旋转cubeGeometry 然后cubetemp 也旋转,所以我通过add 方法将一些cubeTemp 添加到cubeGeometry 中:

cubeGeometry.add(cube);

现在我只需要与 cubeGeometry 中的 cubeTemp 交互,我该怎么做?谢谢:)

【问题讨论】:

    标签: javascript three.js


    【解决方案1】:

    如果您只想访问 cubeTemp,请执行以下操作:

    var cubeTemp = cubeGeometry.children[0];
    

    【讨论】:

      猜你喜欢
      • 2018-08-31
      • 2020-01-29
      • 1970-01-01
      • 2015-11-12
      • 2016-11-28
      • 1970-01-01
      • 2022-01-13
      • 2018-09-24
      • 1970-01-01
      相关资源
      最近更新 更多