我已经得到了这个对象player1,并且我无法让scene.add(Obj);行工作,因为它会出现一个错误,即Obj不存在:
function Player(x, y, z) {
this.Speed = 0;
this.AngleAcc = 0;
this.Angle = 0;
this.X=x;
this.Y=y;
this.Z=z;
this.MaxSpeed = 100;
var PlayerMateririal = new THREE.MeshLambertMaterial({ color: 0x00ff80, overdraw: 0.5 });
this.Obj = new THREE.Mesh(new THREE.BoxGeometry(50, 90, 60), PlayerMateririal);
scene.add(Obj);
Obj.position.set(x, y, z);
}谢谢,我正在使用Three.js,并希望在其他位置设置Obj位置,因此我将其设置为属性。
发布于 2014-12-25 15:33:43
使用此关键字
scene.add(this.Obj);https://stackoverflow.com/questions/27648541
复制相似问题