FORUMS: list search recent posts

limiting rotations

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Matt Howarth
limiting rotations
on Aug 24, 2017 at 3:14:12 pm

hi all

I'm attempting to make an automated pie chart, where you have as many segments as you like and the final segment fits into the remaining space perfectly. I have it working apart from the final segment. I am trying to use the rotation of the previous layer (combined with it's own segment angle) to drive the final segment angle, but because of the way I have set up the previous segments, the penultimate angle can be several times 360 + the angle I want to use. For example:

4x+240.0°

in this instance how to I get rid of the 4x?

I have tried writing a while loop to say while the angle is greater than 360, subtract 360, but it doesn't seem to regard the 4x+240.0° as being more than 360.

Any pointers would be gratefully received.

cheers

Matt

Visual tinkerer and easily distracted admirer of all things shiny! - writer - animator - digital artist


Return to posts index

Chris Wright
Re: limiting rotations
on Aug 24, 2017 at 6:36:36 pm

the good 'ol trig expression pie chart i made a billion years ago
https://forums.creativecow.net/thread/227/17128#17144


Return to posts index

Walter Soyka
Re: limiting rotations
on Aug 25, 2017 at 3:04:02 pm

[Matt Howarth] "I have tried writing a while loop to say while the angle is greater than 360, subtract 360, but it doesn't seem to regard the 4x+240.0° as being more than 360."

Use the modulo operation [link], which returns the remainder after a division operation. 4x+240.0° (or 1680°) modulo 360 equals 240.

Here's sample code:

x = thisComp.layer("LAYER NAME").transform.rotation % 360;

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index


Matt Howarth
Re: limiting rotations
on Aug 26, 2017 at 10:38:28 am

thanks Walter,

that was exactly what I was after : )


cheers

Matt

Visual tinkerer and easily distracted admirer of all things shiny! - writer - animator - digital artist


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]