Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Author Topic: Red and moving steam thing  (Read 12193 times)

ENSONIQ5

  • Hero Member
  • *****
  • Posts: 1012
    • View Profile
    • Mission Backup Earth
Red and moving steam thing
« on: May 30, 2009, 01:38:52 am »

G'day all.

Although the comp is long finished, I have continued working on this thing.



There is still more work that could be done (when is that not the case?), like putting in a driver and perhaps adding a few more dynamic things, like a swinging tow chain on the front bumper or whatever, but I'm done with it for now (gotta get back to other projects).

Everything that rotates is controlled by a script, such as this one below which controls the rotation of the left front wheel:

float $speed;
float $speedbasic;
float $workingframe;
float $a;
float $b;
float $c;
float $d;
float $e;
float $timekey;
$timekey=time*24;
$a=$timekey;
$b=211-(((221-$timekey)*(221-$timekey))/40);
$c=211;
$d=211-((($timekey-279)*($timekey-279))/40);
$e=500-$timekey;
if (frame<201)
$workingframe=$a;
else if (frame<221)
$workingframe=$b;
else if (frame<280)
$workingframe=$c;
else if (frame<300)
$workingframe=$d;
else
$workingframe=$e;
$speedbasic=0.0581776;
$speed=$speedbasic/1.72308;
$orientation = (sin($speed*$workingframe),0,0,cos($speed*$workingframe));


The script rotates the wheel first in a forward direction at a constant speed, decelerates to zero, rests for a bit, accelerates in reverse, and finally reverses at a contant speed.  This script would have been WAY simpler if it were possible to define variables that could be remembered from frame to frame.  At present it is necessary to calculate the position of each rotating object at each frame relative to the object's initial orientation, rather than relative to the objects position in the preceding frame.

The smoke is also scripted, separate scripts controlling each smoke-puff's rotation, location and scale in a cyclic fashion.  The pistons and various valve linkages are keyframed, though scripts would not have been impossible to figure out.

The mechanisms were assembled in Scene mode, rather than defining the whole machine as a figure, using parent/child object relationships to ensure mechanical integrity.  Rendering was done with ART, total rendering time estimated to be over 150 hours.
Logged

$imon

  • Sr. Member
  • ****
  • Posts: 540
    • View Profile
Re: Red and moving steam thing
« Reply #1 on: May 30, 2009, 04:14:49 am »

Wow that is awesome work ensoniq! The best mechanical animation ive seen in anim8or.

I dont know anything about making scripts, but it seems like youve very cleverly made use of them in your animation, great work!

I envy your anim8or skills!
Logged

ENSONIQ5

  • Hero Member
  • *****
  • Posts: 1012
    • View Profile
    • Mission Backup Earth
Re: Red and moving steam thing
« Reply #2 on: May 30, 2009, 10:50:36 pm »

Cheers $imon.  Motion scripts are basically just mathematical ways of defining a Scene element's attributes, as opposed to modelling scripts (which seem to be far more popular in the Scripts link on this site).  Scripts are by far the easiest way to define rigidly repetitive motion, such as rotations or even walk cycles, the only real alternative being tedious keyframing.

The script below defines the position (only the position) of one of the smoke puffs:

float $loft;
float $pseudotime;
if (time<0.5)
$pseudotime=time+1.5;
else if (time<2.5)
$pseudotime=time-0.5;
else if (time<4.5)
$pseudotime=time-2.5;
else if (time<6.5)
$pseudotime=time-4.5;
else if (time<8.5)
$pseudotime=time-6.5;
else if (time<10.5)
$pseudotime=time-8.5;
else if (time<12.5)
$pseudotime=time-10.5;
else if (time<14.5)
$pseudotime=time-12.5;
else if (time<16.5)
$pseudotime=time-14.5;
else if (time<18.5)
$pseudotime=time-16.5;
else
$pseudotime=time-18.5;
$loft=$pseudotime*30;
$position = (($loft*-1)/3, $loft+70, -5);


It's a bit clunky, and could be shortened with better mathematics, but it works ok and is the result of considerable experimentation.  Essentially it steadily raises the element vertically, while moving sideways one third of the rate of lift, and drops it back to the starting point to run the cycle again every two seconds.  A very similar script is applied to the Scale attribute, and a basic rotation script is applied to the Orientation attribute.

The problem with the script above is that it would need to be substantially altered if the animation length was increased, which is not very neat, programmatically.  Unfortunately it is not possible to define running variables, the values of which are remembered from frame to frame.  If this was possible the script above could be shortened to perhaps nine or ten lines, and would be able to accomodate any length of animation without alteration.  Fingers crossed that future versions might allow running variables!
Logged

headwax

  • Sr. Member
  • ****
  • Posts: 600
    • View Profile
    • Headwax's Website
Re: Red and moving steam thing
« Reply #3 on: May 31, 2009, 06:10:51 am »

heh, very impressive Tony. I'm amazed by your skillls! Time, as you say, for a driver!
Logged

captaindrewi

  • Sr. Member
  • ****
  • Posts: 490
  • errm...errr?
    • View Profile
Re: Red and moving steam thing
« Reply #4 on: May 31, 2009, 06:47:10 am »

From the outside, scripts look very complicated but wow what a pay off if you are prepared to go the distance.
Once again marvelous work and thanks for sharing.
Logged
!

lizeal93

  • Full Member
  • ***
  • Posts: 177
  • Coool!
    • View Profile
Re: Red and moving steam thing
« Reply #5 on: May 31, 2009, 04:27:59 pm »

could you give  a little mroe detail on how you made the smoke it seems (from an animatiion standpoint) to be motion correct. akin to a vapor program like fumefx.
Logged
there are two things that are contstant. human stupitity and matter.
and i'm not to sure about the second one.
-Albert Einstien

onespirit5777

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
Re: Red and moving steam thing
« Reply #6 on: May 31, 2009, 07:29:40 pm »

Wish I could script - Gees that's like wow dude!
Logged

ENSONIQ5

  • Hero Member
  • *****
  • Posts: 1012
    • View Profile
    • Mission Backup Earth
Re: Red and moving steam thing
« Reply #7 on: May 31, 2009, 11:07:44 pm »

lizeal93:  I'm glad you think it's motion correct, that means I did something right!  The effect is a total simulation, however, and does not rely on fluidics, but subterfuge and obfuscation!

The smoke is made from two Objects.  The first is a funnel-shaped object, with spiral fluting modelled around the outside.  By spinning this object around the vertical axis an impression of rapid upward movement is kind of achieved.  It's a bit like an old fashioned barber's pole, the rotation giving the impression of vertical motion. 

The second object is a group of three concentric lumpy spheroid things of increasing size.  This object is applied to four separate elements in Scene mode, each controlled by a script in the Location attribute (as above), Scale attribute and Orientation attribute.  These scripts cause the object to rise up and drift either to the front,back, left or right, while getting larger and rotating inwards.  When they reach a height above what the camera can see they start the cycle over again.  Both objects have the same greyish, partially transparent material applied.

This is not an easy thing to explain, so when I get home I will post a trimmed-down .an8 file of the smoke, with the materials and scripts intact.
Logged

ENSONIQ5

  • Hero Member
  • *****
  • Posts: 1012
    • View Profile
    • Mission Backup Earth
Re: Red and moving steam thing
« Reply #8 on: June 01, 2009, 05:23:57 am »

As promised, I have attached a .an8 file which has just the smoke objects and elements, animated with scripts in Scene mode.  I have also attached the two textures needed for the smoke materials, which should be re-applied to the two materials as follows:

Material: Smoke1
In Textures editor, apply "Dirt" to Trans (50%) and Bumpmap (100%) fields.

Material: Smoke2
In Textures editor, apply "Dirt" to Bumpmap (30%) and "Gradient" to Trans (100%)

Any questions or problems let me know.
Logged

captaindrewi

  • Sr. Member
  • ****
  • Posts: 490
  • errm...errr?
    • View Profile
Re: Red and moving steam thing
« Reply #9 on: June 01, 2009, 10:58:00 am »

great being able to have a closer look,
though i'm thinking that something isn't quite right.
Logged
!

Arik_the_Red

  • Sr. Member
  • ****
  • Posts: 785
  • Just another aninoob...
    • View Profile
    • æwakened!
Re: Red and moving steam thing
« Reply #10 on: June 01, 2009, 01:14:02 pm »

Ensoniq5, your work with mechanical whatzits always comes out so nicely.  This is no exception, and the mechanical action - the stop and go, the moving of the motor parts, etc., is all really cool! The smoke effect is pretty interesting, too.

I remember your steam-powered bottle opener being the first one I saw of this style.. I showed it to just about everyone I know! And of course the steam-powered dirigible was a fun thing, too!
Logged

ENSONIQ5

  • Hero Member
  • *****
  • Posts: 1012
    • View Profile
    • Mission Backup Earth
Re: Red and moving steam thing
« Reply #11 on: June 01, 2009, 10:39:59 pm »

Cheers Arik.  I do have a bit of a fascination with steam engines... I think I just love all the moving parts and the brilliant engineering solutions to complex problems.

captaindrewi:  I think the problem might be that you have rendered in Scanline.  The materials were designed to work properly in ART.  If this isn't the case let me know, something else might be awry.
Logged

Indian8or

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Red and moving steam thing
« Reply #12 on: June 01, 2009, 11:53:05 pm »

captaindrewi, do not forget to put the specular value to 0, if i am not wrong.
Logged