3D Solid with progressively increasing opacity along Z-Axis?
Copy link to clipboard
Copied
Hello community!
I'm working on a 3D comp with a bunch of black tiles scattered along the XYZ axis, which are supposed to get whiter the farther away they are from a camera that moves along the Z axis.
The way I want to achieve this is with some sort of white 3D cube parented to the camera which has 0% opacity at Z position 0, and progressively reaches 100% opacity at its maximum Z position (let's say 5000, AKA the opposite end of the cube). Is there any way to do this? Thanks a lot in advance!
I've attached an image that better showcases what I want to achieve for the cube so that you can get a better understanding of what I mean, & a handmade reference of the final result.
Copy link to clipboard
Copied
That makes no sense at all. You would simply measure the distance with length(camera,layer) and tie that into a linear() function or an effect that controls color/ fill opacity internally. The logic is basically just the other way around. you have the layer looking for the camera. something like this would be a simple start:
mCam=thisComp.layer("Camera").transform.position;
mPos=thisLayer.transform.position;
dNear=0; //closest distance
dFar=5000; //farthest distance
oNear=0; //start opacity
oFar=100; //end opacity
mDist=length(mCam,mPos);
linear(mDist,dNear,dFar,oNear,oFar);
Mylenium
Copy link to clipboard
Copied
Thank you. I now consider my question solved!

