We are creating multiple animations for fading in and fade out parts of an assembly in three.js using animation clip and action.
At first selecting the overall assembly and applying fade to it
below fade Value will is 1 for fade in and 0 for fade out.
KF = new THREE.NumberKeyframeTrack(‘.opacity’, [StartTime,EndTime], [mesh.material.opacity, fadeValue]);
let clip = new THREE.AnimationClip(cId.toString(), actualTimes[cId].aEndTime, [KF]);
mClips[cId].push({ clip: clip, material: mesh.material[i] });
let animation_action = Mixer.clipAction(clip, mesh.material[i]);
Later after having 4 different animations like this when we play the actions we notice a transperacy in the parts.
the complete part is not visible in the animation .
After some investigation we found that the issue might be related to depth right and depth test property of the material
but we could fix that for parts that are present at the top of the assembly.
In below case a rod is present under the cube. Using the depth right approach the issue for the square is fixed but the parts that are
present under the surface of the square are still not visible. Is it the issue level of depth these property works.
any suggestions will be helpful.