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

3D expression for opacity and twist

New Here ,
Jan 04, 2022 Jan 04, 2022

Hey guys,

I need some help.

 

I am currently working on a project and I don't know how to finish it.

 

I have 6 images that follow the 3D rotation of a null-object (see on gif).

 

I want them to have a differnt twist when they come closer to the camera and move to the right and further away. (for examle: it starts with 100 degrees and when it moves closer to the camera it automatically turns and at the end it has 180 degrees on the right side).

 

 

Also it should disappear at a specific point so it doesnt appear at the back of the screen. Maybe there is a possibility to let them appear on the left side again.

 

 

I would really appreciate it if anyone knows any suitable expressions?

Christina

TOPICS
Expressions
294
Translate
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

correct answers 1 Correct answer

New Here , Jan 10, 2022 Jan 10, 2022

Thanks for the fast answer.
I tried some differnet ways. Every single one had a ".toWorld" expression.

 

Here the final solution:

The serveral object had expressins in

 

  • xPos:

thisComp.layer("xPos").effect("Abstand Icons")("Schieberegler")*(index -1)

 

  • zPos: 
relativeXPosition = (Math.abs((thisComp.width/2) - thisLayer.toWorld(thisLayer.transform.anchorPoint)[0]))+thisComp.layer("xPos").effect("MaximumGroese")("Schieberegler");
if(relativeXPosition <= thisComp.layer("xPos").effect("MaximumDistanz")("Schieb
...
Translate
Community Expert ,
Jan 06, 2022 Jan 06, 2022

Check out the toWorld() expression:

https://ae-expressions.docsforadobe.dev/layer-space.html?highlight=toworld#toworld-point-t-time

 

Basically you want to get the toWorld() position of each object, and then measure that to another point in space, or a null. If you just want to compare the Z position, then grab the third element or [2]

const a = thisComp.layer("Null 2").toWorld([0,0,0])[2];
const b = thisComp.layer("Null 1").toWorld([0,0,0])[2];
const diff = a - b;

 Once you have that difference, you'll want to plug it into an interpolation operator like linear() or ease() to adjust opacity or twist or whatever between 2 values.

Translate
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 ,
Jan 10, 2022 Jan 10, 2022
LATEST

Thanks for the fast answer.
I tried some differnet ways. Every single one had a ".toWorld" expression.

 

Here the final solution:

The serveral object had expressins in

 

  • xPos:

thisComp.layer("xPos").effect("Abstand Icons")("Schieberegler")*(index -1)

 

  • zPos: 
relativeXPosition = (Math.abs((thisComp.width/2) - thisLayer.toWorld(thisLayer.transform.anchorPoint)[0]))+thisComp.layer("xPos").effect("MaximumGroese")("Schieberegler");
if(relativeXPosition <= thisComp.layer("xPos").effect("MaximumDistanz")("Schieberegler")){
relativeXPosition = thisComp.layer("xPos").effect("MaximumDistanz")("Schieberegler"); } 
zPosition = relativeXPosition;
 
  • Skal:
XAbstand = (thisComp.width/2) - thisLayer.toWorld(thisLayer.transform.anchorPoint)[0] ;
rechnung = 100-(Math.abs(XAbstand/10));
scaleVar = [100,100,100];
if (rechnung <= thisComp.layer("xPos").effect("kleinste skal")("Schieberegler")){
scaleVar = thisComp.layer("xPos").effect("kleinste skal")("Schieberegler");}
else{ scaleVar = rechnung;}
scale = [scaleVar,scaleVar,scaleVar];
 
  • yRotation:
XAbstand = (thisComp.width/2) - thisLayer.toWorld(thisLayer.transform.anchorPoint)[0] ;
rechnung = XAbstand/4;
if (rechnung <= -thisComp.layer("xPos").effect("MaximumDreheung")("Schieberegler")){
yRotation = 90-thisComp.layer("xPos").effect("MaximumDreheung")("Schieberegler");}
else if(rechnung >= thisComp.layer("xPos").effect("MaximumDreheung")("Schieberegler")){
yRotation = 90+thisComp.layer("xPos").effect("MaximumDreheung")("Schieberegler"); }
else{ rotation = 90+rechnung;}
 
  • Transp:
XAbstand = (thisComp.width/2) - thisLayer.toWorld(thisLayer.transform.anchorPoint)[0] ;
rechnung = 100-(Math.abs((XAbstand)/thisComp.layer("xPos").effect("Deckkraft")("Schieberegler")));
if (rechnung <= 50){
opacity = 0;}
else{ opacity = 100;}

 

The object was parented to a Null-Object which had several Slider (7: for the distance, size, rotation, maxRotation, Transparency, smalScal, distance Elements) to have alterable Elements. The expressions work for several Elements so the first Element can be duplicated and replaced. There is only one important part that need to be memorised: The layers need to be in the right order because of the "index"- part in the expression (The null-object needs to be the last).

 

Hope this helps for future questions!

Translate
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