Slashdot Mirror


Toolkits for 2D Animation?

profBill asks: "I work in the area of complex adaptive systems, that is understanding the emergence of complexity from the interactions of many elements (immune systems, economies, ecosystems, etc.). In particular we are using evolutionary computation to create elements/creatures that can co-exist in an ecosystem with certain interactions and relationships. All that is very interesting, but in the end, assuming we create such creatures, I have to show them to the ecologists and biologists so they can understand what is going on. The only way I can imagine doing it easily, other than with graphs and charts, is to create a 2D animation of the creatures and their interactions that these folks can watch. My problem is that there are so many choices for a toolkit to build such a 2D animation. My goal is not a movie of ILM quality, but something 'good enough'."

"'Good enough' for me means:

  • Quick and dirty, that I can tune as needed.
  • Zoom capability on a grid
  • Pop up menus on any one grid element to get information.
  • Scrolling, resizing, the typical.
  • Be able to hook to a C/C++ program to get a creature's behavior
What would you use to build such an animation?"

21 comments

  1. Flash would work, right? by joFFeman · · Score: 1, Insightful

    With Macromedia's Director (there may be a new name for the MX version), you can basically construct entire applications. You could integrate pretty much any application with it. The fact is, flash is going to be the best way to create part of it, even if you don't construct the entire program with it. The portability is another plus. Maybe a hybrid of java and flash would be in order if you're looking for ease of coding coupled with a reasonable amount of power and portability.

    --
    "Life is great; without it, you'd be dead." -Harmony Korine
  2. Well, if there are so many.... by joto · · Score: 2
    ...and you don't really need anymore than "good enough"...

    ...then WHY DON'T YOU JUST PICK ONE?

    If all you want to do is display simple "good-enough" 2D-animation, any 2D-toolkit would do. If you want zooming, etc, you will probably have to write that yourself, I can't imagine what features a 2D-toolkit could offer, that would avoid you having to write the actual code for display.

  3. perl::flash by tolldog · · Score: 2

    I know that people have been doing 2D animation in flash for a while now... we even have a new video series that uses it. ( Larry Boy ) I imagine you could throw something together using perltk and perl::flash to create flash movies. I haven't played with the perl::flash stuff, but I imagine it isn't too steep of learning curve. -Tim

    --
    -I just work here... how am I supposed to know?
  4. The obvious answer by MarkusQ · · Score: 3, Insightful

    Q: What would you use to build such an animation?

    A: A programming language. Say, C or C++?

    Seriously. Consider your criteria:

    Quick and dirty, that I can tune as needed.
    So to produce a frame, you have each "creature" draw themselves if they overlap the present view area. The detail of each creature's "look" is local to that creature, so you can tune/tweak it at need. Done.

    Zoom capability on a grid
    The "present view" data includes a view-center and a scale factor, which all the drawing primatives use to translate from world coordinates to screen coordinates. Clicking on a point on the grid may make that point the new screen center and increase/decrease the scale factor, depending on which "tool" (the magnifying glass, etc.) the user has sellected. Done.

    Pop up menus on any one grid element to get information.
    Trivial. When the mouse hovers, or they right click, or press control-yada-yada-cokebottle, or wahatever, pop up your menu. If you also want information about each creature, use a (perhap subtilly) different colour for each creature and check the colour of the creature under the mouse to determine what to pop up. Done.

    Scrolling, resizing, the typical.
    Done.

    Be able to hook to a C/C++ program to get a creature's behavior
    Done.

    It shouldn't take much longer to write than it took to ask the question, or to answer it.

    -- MarkusQ

    1. Re:The obvious answer by Anonymous Coward · · Score: 0
      If you also want information about each creature, use a (perhap subtilly) different colour for each creature and check the colour of the creature under the mouse to determine what to pop up
      That works only for ASCII dungeon games where there are 4 types of enemies, gold and keys, my friend.
  5. Qt anyone? by Anonymous Coward · · Score: 1, Insightful

    Funny you should ask this question...

    I just coded the front end to a networked AI simulation with creatures that play, eat, interact, etc. I basically did everything you said you wanted...2d grid with mouse zooming/panning, tweakable creatures, interfacing with c++ AI and network packages. Did the whole thing using Qt's 2d graphics library...was generally quite straightforward (albeit not the fastest). If you can deal with c++ coding I'd recommend it highly.

    Info can be found at http://www.trolltech.com

  6. Re:Flash would work, right? Wrong! by ore · · Score: 1, Informative
    I'll have to disagree with using Flash. It's closed, it costs money, etc, etc. Use SVG instead. Being XML based it is simply a matter of constructing a text file and then running it through an viewer. If it turns out not to have the scope of primitives that you need you can try something else. However, I bet that you'll be able to do most of the animations that you have imagined with little difficulty.

    On a related note, I've concentrated quite a bit over the past year in generating charts and graphs to multiple output formats simultaneously. Of interest here are some new versions of old standard apps, Gnuplot and Graphviz. Both applications contain SVG output capabilities in their latest builds. I've been using both to generate both PNG, but also PS and SVG. I will generally convert the PS to PDF via Ghostscript. To me this represents an incredible time savings by allowing me to generate PNG's to act as thumbnails for the SVG and PDF versions of the same graph. Consider also the ability to nest SVG objects within a larger SVG picture (or animation). To aid in technical illustration you could actually embed SVG chart animations with the other custom 2D animations that you seek to create to further clarify the idea you are trying to present.

    Raster, vector and publication quality visualizations in one fell swoop without spending a dime. Schweet!

  7. Java2D, SDL, OpenGL by ikekrull · · Score: 4, Informative

    Both of these are crossplatform solutions for doing the kind of thing you require.

    Java2D is easier to develop with, especially if you are not a C/C++ person, and comes with a full set of widgets for supporting UI purposes.

    I might suggest you prototype your application in Java2D, and if you cannot extract useful speed out of it, to port to SDL or OpenGL, if you require interactive framerates.

    OpenGL is most often used as a 3D API, but using textured polygons (or compiled display-lists of lines/polygons for better zooming/resolution independence) for your elements in orthographic projection will provide optimum performance on a plaform with hardware 3D acceleration.

    However, properly written, there is no reason why Java will not provide you with adequate-to-good speed.

    There is also no reason why you couldn't do this with GTK, Qt, etc.

    Really, you should be looking at this from the point of view of 'which language do i feel most comfortable with, and is there a mature 2D graphics libabry for this language?' If so, use it.

    --
    I gots ta ding a ding dang my dang a long ling long
  8. Sounds like fun by RevAaron · · Score: 4, Informative

    I did an REU last summer analyzing various ecology-oriented datasets collected in beaver meadows. One of the things we used for this analysis was an application I wrote for visualization. 10 plots in the window, scrolled in unison, click to get details on each point, zoom-in and out &c. In any case, this got me excited, and I've been searching for an existing model of an ecological system for which I could create a plugin for my visualizer.

    My setup for the 2D non-animated data browser I created: Squeak 3.0 with some classes borrowed (PlotMorph) and a bunch of others that I wrote myself.

    I've not started my animation/modeling work yet, that will be something I'll be working on after finals for a fun project. But my software setup will be the same, but manipulating the information and thus changing the direction of the modeled and animated creatures in real-time.

    I may do this using Alice3D, which is a 3D environment within Squeak, or just by using the native GUI toolkit of Squeak, Morphic, which really accommodates doing this kind of work. 2D animation is trivial. You just have each object have a #step method that applies whatever needed changes are required, and a #stepTime method that determines what the interval between updates is.

    If you're a C/C++/Java bigot, Smalltalk may come as a bit of a shock. But if you're interested in the best tool for the job, and are looking for an intuitive way to do 2D modelling and animation, Squeak is definitely worth evaluation.

    You can email me if there's any other questions you have about my work, or about how useful Squeak is for this kind of stuff- I'd be happy to help.

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    1. Re:Sounds like fun by RevAaron · · Score: 2

      Just remembered something... Within the stock Squeak image, are some classes that go under the heading "StarSqueak." StarSqueak is a Squeak port/analog of StarLogo, a Logo dialect aimed at big Logo-driven simulations with many (hundreds-thousands) of "turtles." In the Squeak version, the coding of the "Turtles" (agents) and the world is done in Smalltalk, rather than logo. Info.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  9. convincing your employer to open source by Anonymous Coward · · Score: 0
    Hi,

    Although my employer doesn't like the idea of open sourcing entire programs (and, I agree with them on that point!), I was able to convince them that open sourcing certain algorithms and routines would be beneficial. And has it!

    For example, a couple years ago, we needed to model sp^3 bonding occuring during nuclear fusion to help optimize a nuclear power plant. Sounds tough. Even tougher, it had to be modelled in real-time so we could see how the dipole-dipole interactions would be affected!

    The vector matrix calculations were written in PERL since it provided the best speed. However, I suspected it could be optimized even more than it was (I was using a fast-fourier transformation model). I released the PERL routine under a BSD license (so we could reintegrate it). Within a month, a graduate student in Switzerland was able to improve the speed by another 10% based on some lienear-interpolative binomial algorithms.

    Often, we don't get any usefull feedback from the code we open source, but sometimes, we do get some valuable information

    1. Re:convincing your employer to open source by littlerubberfeet · · Score: 1

      Its obvious this AC is full of bullshit. and besides, this has to do with 2D animation exactly how? In nuclear research the visuals are not nearly as important as the raw numbers, which do need to be calculated in realtime.
      Just cause you can toss around jargon doesn't mean you know anything.
      2D animation: you could invest the time to hand-draw it, label it 'high art' and sell it for the cube of what it would otherwise sell for.

      --
      Sig (appended to the end of comments you post, 120 chars)
  10. some pointers by g4dget · · Score: 3, Informative
    Here are some pointers:
    • Look into Swarm: it's a complete simulation environment, from your institution even, and includes graphics.
    • Look for toolkits for doing "sprite animation" on Freshmeat (there is almost certainly something for SDL).
    • Look into one of the structured graphics toolkits, like the one that comes with wxWindows. There are also several for Java.
    • Look into OpenGL; it's easy to use.
    • Look into the 3D game toolkits (like Crystalspace) and use them in a 2D manner.
  11. Yet Another Ask Google Question by Anonymous Coward · · Score: 0
  12. You may look at this by bbk · · Score: 2

    I know a guy working on this project:

    http://sourceforge.net/projects/lmljpeg/

    Part of the project includes what has been described as a "Multiplane camera", wbich emulates a stack of cels, which can be defined by XML data, and the individual cels can be programatically defined in C++, ie a cell that shows falling snow/rain/etc. It was originally intended for 2d cel animation, but may be workable for your purposes.

    The other part is a MJPEG software encoder/decoder for the zoran MJPEG chipset.

    BBK

  13. Good 2D Toolkit by good-n-nappy · · Score: 1

    Take a look at Jazz. It has a 2D scenegraph and support for animation and zooming.

    Also, you might look at Squeak and Morphic.

    --
    Never underestimate the power of fiber.