Ich möchte eine Tweening-Position für dieses Objekt ausführen, und wenn es fertig ist, fade es aus ... Momentan verstecke ich es nur, wenn es fertig ist.Fade-Objekt unsichtbar, nachdem die Tweening-Position beendet ist
this.tweenBox2.onUpdate(function()
{
that.box.position = a;
that.box.Show();
});
this.tweenBox2.onComplete(function() {
for (var i = 0; i < that.box.children.length; i++) {
that.box.children[i].visible = false;
}
that.box.position = new THREE.Vector3().copy(storagePos);
});
ist hier, was in box.children [0]
istTHREE.Mesh
webglActive : wahr __webglInit : wahr _modelViewMatrix : THREE.Matrix4 _normalMatrix : DREI.Matrix3 castShado w : falsch Kinder : Array [0] eulerOrder : (...) frustumCulled : wahre Geometrie : THREE.Geometry id : Material : THREE .MeshLambertMaterial Matrix : DREI.Matrix4 MatrixAutoUpdate : wahr matrixWorld : THREE.Matrix4 matrixWorldNeedsUpdate : falsch Name : "" Mutter : Box Position : THREE.Vector3 quaternion : THREE.Quaternion receiveShadow : falsch renderDepth : null Rotation: THREE.Euler rotationAutoUpdate : wahr Skala : THREE.Vector3 bis : THREE.Vector3 useQuaternion : (...) Userdata : Objekt Uuid : "9C6DC789-20D0-4F9F-88B6-CDA9A2C372B9" sichtbar : wahr __proto : DREI.Object3D
Das Material auf diese Weise erstellt:
var box = boxModel.scene.children[3].children[0].clone();
box.traverse(function (child)
{
if (child instanceof THREE.Mesh)
{
child.material = child.material.clone();
}
});
Ich sehe, dass Sie ein Material klonen, aber wenn Sie es zuerst erstellen, setzen Sie transparent auf wahr? – leota