Menu

animation thoughts

Neon22
2009-01-22
2013-05-28
  • Neon22

    Neon22 - 2009-01-22

    Just some notes on animation:

    It seems as though the evaluation currently proceeds in a breadth first traversal for creation of the scene.

    For animation we might want to traverse the tree in a depth first order so that objects appear to 'grow' from nothing to completion.
    Probably the user would want to choose which traversal method was used as it would depend on the type of scene created

    Which would mean creating and holding the entire tree and then traversing it to export it.

    For animating 'growing' a simple approach would be to export all objects in final positions and for the animation to be a visibility animation which turned on objects in order over time. (or to scale each new object up from 0 one-at-a time so they do not 'pop' on)

    However this would not help for an animation where the shape moved from one state to another. For this to work the seed for rule evaluation would need to remain the same (else the topology would change - which would be very jarring) but an additional seed could be used to randomize direction, distance, scale, color, etc, as the rules were evaluated.

    The end result would be a number of 'runs' which the animation could then use to move between - giving such things as waving branches, 'flowers growing', etc.

    so:
    For a single seed (single scene - current behaviour):
    - choose traversal method - breadth, depth
    - for each object:
       - scale from,to                                  and/or
       - rotate from,to                                and/or
       - color, etc (any param) from/to       and/or
       - visibility fade up,down
       - over some time period
    For multiple passes (given by list of non-topology changing seeds)
    - choose traversal method - breadth, depth
    - for each matched object:
       - interpolate transforms (using tree as hierarchy to avoid disconnection)
       - scale from,to                         and/or
       - rotate from,to                       and/or
       - color etc...                             and/or
       - visibility fade up,down
       - over some time period

    Just thoughts...

     
    • Mikael Hvidtfeldt Christensen

      Hi again,

      I have already given animation some thoughts, and think I have a good solution.

      First of all, 'depth first traversal' gives problems for systems such as:

      Rule R1 {
          R1
          BOX
      }

      This would just recurse infinitely without ever producing a primitive - and even worse you would never get similar structures for two different depths, since the random numbers would be pulled depth-first too.

      I've started working on integrating a JavaScript parser in Structure Synth, which can be used to setup workflows.
      From this parser it will be possible to change the preprocessor constants (introduced in SS0.9) programmatically.

      So if you want to make a growing animation, you would write a small JavaScript script:

      #javascript

      for (int i = 0; i < 100; i++) {
            Builder.load("myTree.es"); // load the eisenscript file.
            Builder.setSeed(5); // make sure we get exactly the same scene.
            Builder.setVariable("maxdepth", i); // controls the recursion depth.
            Builder.build();
            Builder.renderToTemplate("Sunflow", "frame"+i+".sc");
      }

      I think this approach will be quite flexible.

      Regards, Mikael.

       
    • Neon22

      Neon22 - 2009-01-22

      Looks great :-)
      Seems ideal for animations that show the progression of the rule evaluation.

      I was also trying to encompass animations where the objects in the rule set change shape/position/color etc. Hence my suggestion re multiple seeds for non-topology changing parameters (like color). I know Structure Synth doesn't do this now - however I think it would be useful in the  future.

      E.g.
      - an animation where all the 'flowers' in the tree change color, or scale up from zero
      - or an animation where the 'branches' move from one position to another.
      Even a rule which defined which 'scenes' were interpolated with time as the variable. No one else is applying rules like this to time as well as spatial structures - and I see in the roadmap a desire to make it interactive at some point.

      Clearly depth traversal at rule creation time would fail. What I was trying to say was that if the tree was stored when created - then traversing the resulting tree in depth order would allow for another kind of animation.

      Cheers...

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.