如何获得three.js json模型的顶点位置

时间:2015-06-30 17:05:16

标签: javascript three.js

我使用此代码加载THREE.js json模型:

var noisenormalmap = THREE.ImageUtils.loadTexture( "obj/jgd/noisenormalmap.png" );
noisenormalmap.wrapS = THREE.RepeatWrapping;
noisenormalmap.wrapT = THREE.RepeatWrapping;
noisenormalmap.repeat.set( 5, 5 );

var loader = new THREE.JSONLoader();
loader.load( 'myobject.json', function ( geometry ) {
    JGDframe = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial( {
         color: 0xAF0000 ,
         side: THREE.DoubleSide,
         specular: 0x222222,
         shininess: 1000,
         emissive:0x000000,

         normalMap: noisenormalmap,
         normalScale: new THREE.Vector2( 0.32, 0.32 ),

         envMap: reflectionCube,
         reflectivity:0.82,
         refractionRatio:0.1,
         combine: THREE.AddOperation
     } ) );
     scene.add( JGDframe );
});

我想得到myobject.json.geometry.vertex[0].position.x。我怎么能得到它?

1 个答案:

答案 0 :(得分:0)

JGDframe.geometry.vertices[0].xyz