• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

3D Solid with progressively increasing opacity along Z-Axis?

New Here ,
Dec 14, 2024 Dec 14, 2024

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.

TOPICS
Expressions , How to

Views

205

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 14, 2024 Dec 14, 2024

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2024 Dec 14, 2024

Copy link to clipboard

Copied

LATEST

Thank you. I now consider my question solved!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines