-
Layer Space Transforms with offset
Hi all,
I’m trying to have 2d layers follow 3d layers in space. The effect is a 3d timeline with 2d numbers labeling the increments marked by 3d dots. I currently have it setup so that as you duplicate layers, they increment and offset to extend the timeline. My approach is to transform the 3d dots’ coordinates with toComp and fromComp as follows but the offset seems to be off.
What i think is going on is the offset is being applied to the wrong type of coordinates but i’m not sure how to add it in the correct way.
This shows how the first base point “4” (the one that has no offset) aligns correctly. But as you duplicate the layer and it automatically increments itself it doesn’t align along the 3d timeline correctly, using the code below.
Any suggestions are appreciated. Thanks.
Here’s what I have for the positioning of the 2d layers (the comments are what i think is supposed to occur):
x = "the offset spacing between dots on the 3d timeline"; //calculates the number of increments and size of increments away from the base point of the timeline that travels along the x axis. This is determined by user input and the index of the layer.L = comp("3dTimeline").layer("BasePointOfTimeline"); // gets the base point of the timeline
AP = [L.anchorPoint[0]+x, L.anchorPoint[1], L.anchorPoint[2]]; //adds the calculated offset to the x value that the 3d timeline travels along.
fromComp(L.toComp(AP)) //transforms the coordinate with the offset to it's 2d equivalent.
