Animating color change

xcoder77

New member
Hello all,
Been using Cheetah 3D a while and loving its simplicity, first time poster.

I'm working on a 3D timer animation with a basic black cylinder, trying to add a color incrementally to each of the 100 segments/surfaces each few frames giving the appearance (similar to that of a ticking clock). I have done this successfully rendering a PNG for each frame (100 PNG files), but it's a really inefficient in my code engine. I would like to do it as a JPEG mov (JPEG codec because the background color can be transparent) as I can manipulate each frame of the movie with code and a timer within the 3d engine for better effect.

The problem I'm having is getting the animation to show the changed color on each keyframe (color change not showing), is this possible in cheetah? or am I missing something blatantly obvious?
I've included a couple of PNG files to show the effect I'm after.
Thanks for any help.
 

Attachments

  • 1.png
    1.png
    26 KB · Views: 193
  • 2.png
    2.png
    26.1 KB · Views: 205
Thanks so much for your fast reply Ellen!
What I'm looking for definitely can be done in Cheetah from your lovely example.
Not sure why my keyframes aren't recording color change per segment (animation works fine if I move the cylinder)
More like this static type animation (rather than a rotation):
 

Attachments

  • 3.png
    3.png
    108.6 KB · Views: 208
  • 4.png
    4.png
    107.4 KB · Views: 198
  • 5.png
    5.png
    106.9 KB · Views: 196
  • 6.png
    6.png
    105.8 KB · Views: 202
Last edited:
I´m using a conical gradient masked by one hundredth of a 100 segmented cylinder.
Can you upload an example file? I'm still not sure where the color change should take place.
 
I'm trying to change a segment color to yellow every 10 frames incrementally until the cylinder is full (a bit like a pie chart 'ticking' round)
I've tried to make a key frame every 10 frames after changing a segment color, but the animation only shows the final keyframe.
JAS file attached (keyframes removed because it didn't work), not sure how I'm doing it wrong ;P
I can't seem to attach the JAS file (greyed out) -Edit silly me, should have zipped it first
Thanks so much for your help Ellen
 

Attachments

  • Screen Shot.png
    Screen Shot.png
    435.3 KB · Views: 198
  • 1.jas.zip
    20.4 KB · Views: 164
Last edited:
In order to create an incremental progress I use a polygon strip warped into a disc with a bend modifier.
Now the v-coordinate of the uv map will cover the segments of a circle.

A material simply needs to animate this, here done by decreasing the edge-2 value of a pulse node fed with the v-coordinate.
The resulting image sequence in the render history will contain 100 images with continuous coverage from 0 to 100.
(Edit: using a step node instead of a pulse node is even easier)

image_00025.png image_00099.png
 

Attachments

  • Timer.jas.zip
    12.3 KB · Views: 180
Last edited:
I can't seem to attach the JAS file (greyed out)
Well need to compress it to ZIP-files for an upload. I'd say it's possible - no question - but you need 2 keyframes per 3,6° rotation. 1 for the 3,6° incremental rotation and 1 for the color change (diffuse channel in this case):
ColorAnimation.gif
 

Attachments

  • ColorChangeAnim.jas.zip
    11.3 KB · Views: 170
Thanks for all your great replies.
I'll take my time going through them to try and understand how you lot did them all. I have to admit some of them seem too complicated for my skill level as yet, but thank you all nonetheless.
I was initially hoping I could simply change a material/vertex color for a segment and add a keyframe for each change, but..

cheers
 
Thanks Ellen. Your last example is exactly what I'm looking for.
Do I need to write a Javascript for a parametric cylinder moving from 0-360 degrees?
I can't find the relevant settings in the properties of my cylinder. Checked google, but there doesn't seem to be much Cheetah 3D parametric info out there.
 
the parametric cylinder can be recorded from 0-360°
It is even possible to animate the longitudinal sections so that in each frame one section is added.
There is a minimum section limit of three, so for a 100 frames/sections animation the angle runs from 0° at frame 0 to 360° at frame 100 but
the section number goes from 3 at frame 3 to 100 at frame 100.
screenshot2.jpg
@xcoder77:
In the screenshot you find all parameters of the cylinder in the properties column on the right.
Choosing a frame, you type a parameter value in there and then right-click on the red recording button in the timeline.
All animatable parameters will be listed and you now choose the one you have adjusted.
In the file attached below you can check how the "sections longitudinal" and "to angle" parameters are keyframed.
 

Attachments

  • cyltimer.jas.zip
    5.7 KB · Views: 175
Last edited:
It is even possible to animate the longitudinal sections so that in each frame one section is added.
With the small flaw that the cylinder does not accept amount of sections below 3 and it's not going to be in sync or stepped by 3.6° per frame - if that's important anyway you´d find out already.
TikTak.png
 
Lots of math reasons for those limitations.

I suspect the Cylinder creator has code to handle two special circumstances:
a) if the From and To Angle values are 0 and 360, it completely bypass drawing the start and end polygons, closing the complete cylinder shape.
b) if the From and To Angles are the same, OR if the To Angle is less than the From Angle value, it bypasses creating the object at all.

These prevent the creation routine, which usually steps its way around the cylinder's core to create the form, from wrapping around the cylinder more than once ( which would run a serious risk of creating polygons precisely on top of each other, or at the very least creating a shape that wouldn't play nicely with the Boolean engine. Neither of those options would render well, either ).

For much the same reasons, it can't create acceptable cylinder forms that have less than 3 Longitudinal Sections. If it had none, there would be no object. If it had 1, having From and To Angles greater than 180° apart would build an inverted object that has its rendering surfaces facing the inside of the cylinder instead of the outside. If it had 2 Longitudinal Sections, a cylinder with From and To Angles exactly 180° apart would place those surfaces directly on top of each other, which would render badly. With 3 or more Longitudinal Surfaces, there will always be a properly created, solid 3D form.

Upon further reflection, I suppose 2 Longitudinal Sections might work up until 360° - which, I believe, would trigger my hypothetical special case code, but it wouldn't look much like a Cylinder.

The upper limit of the Longitudinal Sections value is 250, probably because values that particular size and smaller save some memory space (computers really like numbers in the range 0-255), and any more sections would be practically invisible with the use of any Smoothing at all. Basically, it would create a boatload of generally unnecessary polygons.

If you're timing your animation to a 60 second minute, than you could easily simplify the math by working with 240 sections to get easily predictable results ( while a 0 Longitudinal Sections value would be gracefully handled by not rendering the cylinder at all in that frame. )

That's my geeking out for the week. :)
 
Last edited:
@EllenM
Thanks again for helping out trying to explain it all to me

@MonkeyT
Thanks for your geeking out (a little over my head at my skill level), interesting reading.

At the moment I've had to go back to creating 100 PNG files which I will use to create a movie in camtasia later to get a prototype up and running faster and worry about cleaning it all up later (I'm not running Catalina due to still having a couple of 32 bit apps which I often use, so I can't take advantage of Quicktime image to animation feature).
The biggest problem is rendering the MOV in Cheetah not removing the background, even when rendering with Prores 4444. As far as I know it should support transparency (JPEG 2000 should do the same too). Animated GIF is a non-stater because of quality issues and the coding 3D engine I'm using doesn't support GIF. Sorry for hijacking my own thread.
If I'm missing something in Cheetah for this please let me know.

Just like to say thanks to all those that contributed to this thread. This community is amazing!
 
This is the AlienWalk file from the Help menu with a transparent Camera background - rendered as animation and saved into ProRes4444 container - placed in Camtasia (2.10.8) over 2 stacked shapes:
TransparentCameraBG.gif

I attached the file for you to check out.
 

Attachments

  • Alien walk-TransparencyCameraBG.jas.zip
    157.9 KB · Views: 168
Back
Top