0:(-10*cos(3.141*t/5)+15) gives a value of 24 at frame 6. What?
Hi all!
I think I've misunderstood the instructions in MATHs in DeforumV05:
The artist wants to use a constant value of 0.8 as their strength schedule. However, they wish they could have more detail appear in their animation. A value of 0.45 is great for adding new enriched content to a scene, but it causes very little coherency. The artist decides that they should only introduce the value of 0.45 periodically about every 25 frames, yet keep it 0.8 for most of the sequence. How should the artist express this using MATHs?
0:(-0.35*(cos(3.141*t/25)**100)+0.8)
In this expression we’re selecting a cosine function (cos) to allow our wave to have small periodic dips instead of peaks.The double asterisk acts as an exponent function and brings the cosine to the 100th power, tightening the dips into small indents along the timeline.The addition of +0.8 sets the baseline at 0.8 which the artist agreed was desirable for the animation, and starts the function with -0.35 knowing that it will dip below the established baseline from 0.8 down to 0.45 as expected. An approximation of pi is being used again (3.141) to align the frames to integers, and t is being divided by 25 to enforce the dip to occur only at frames that are multiples of 25. Our artist has achieved the schedule using one expression that will be calculated for the duration of the animation frames.
I've put a strikethrough on the "100th power"-part, because I didn't want that in my expression.
As I understand it (probably wrong), in the following expression, "0:(-10*cos(3.141*t/5)+15)", at frame 1 I should be getting a value of 5 (which I am), and at frame 5 I should be getting 15. But I'm not. At frame 5 I'm getting 23, and at frame 6, 24, then it counts backward to 6 (I only have 10 frames in total for this example).
TL;DR:
With the following expression, "0:(-10*cos(3.141*t/5)+15)", I'm getting the following consecutive values (in a total of 10 frames): 5, 6, 11, 18, 23, 24, 23, 18, 11, 6.
What am I doing wrong? It's been about 12 years since I had math in school, so it isn't really my strong suit, but I'm trying to learn! Any advice is greatly appreciated!
Edited 11 Oct 2023. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 1 · 60% up
- Kind
- Text
- ID
- 175f2wc
6 comments
At frame 0 you should get 5. At frame 5 you should get 25 if you use the full value of pi, so I think it's probably rounding down to the next whole number given you're only using 3.141. Solve the inside of cos first, then multiply by negative 10, then add 15. At t=5 you just have cos(π) which is -1. Times -10 is 10. Plus 15 is 25.
Thank you! That makes much more sense. How would that expression look if I wanted a sine wave going from a baseline value of 5 to a top value of 15 every 5 frames?
I'm terrible at learning from written instructions, (I learn better by doing), but I've been going back and forth with this expression for hours now, and while each result is interesting, I don't feel like I'm moving forward. You'd be doing me a real solid.
If you're using sin, sin(0)=0, and the values of sin are between -1 and 1. Sin hits 1 at π/2, back to 0 at π and -1 at 3π/2. The range of the fluctuations are going to scale with the scalar value out front. So if you want to range between 5 and 15, you have a scalar of 5 with a center value of 10, which you got already. So the trick is to have the sin function start and end where you want, so you want sin to equal -1 at the frame 0 and 1 at frame 5. So when t=0 the inside of this sin expression will equal 3π/2: sin(3π/2 + t*π/5). And it's incremented by π every 5 frames. So this will start at -1 and end at 1 at frame 5. So your full equations should be:
(5sin(3π/2 + tπ/5)+10)
https://www.framesync.xyz/
Oh my God, thank you so much!