Jarl2D. Java animation made easy.
Home | Features | Faq | Getting Started | Tutorial | Example Guide | Jarl Objects | Resources and Links | Downloads
Quick Links
SourceForge Project Page
Download
Jarl2D mailing lists
Recent News
Updated Getting Started Documentation
Jarl2d Reaches Beta
How can i make a feature request, report a bug, or just give some general feedback?
PositionPath release
PositionPath
Getting Started for new users to Jarl2d
Review the Readme
Fire up the GUI
What does it take to create a Jarl2d Animation
Timing
Review the Readme
  • Before continuing, make sure to review the readme.txt file for general information about the Jarl2d release. The readme also describes how to download and extract the Jarl2d release as well as where to obtain the appropriate JDK for your operating system.
  •  

Fire up the GUI
  • Jarl2d has two main 'modes' of operation: building/designing the animation and rendering the animation. Both can be done with the GUI (and both can be done via command line), which can be launched by running run.bat(windows) and run.sh(*nix).
  •  
  • After starting the GUI (which requires a Java1.4JDK...for details see here. Next, browse to one of the over 50 examples provided with the file browse button. Then, click the "Render Single Frame" button, and after a brief pause for parsing and rendering, you'll see a frame from your current animation rendered.
  •  
  • On the left hand side, you'll see a slider that allows you to change frames. You can move the slider around and then click the render button again to see a different frame.
  •  
  • In the options box (again on the left hand side), you'll see a check box: "Reuse Frame". If this is selected then every new frame you render will be drawn in the same window.
  •  
  • If you're interested in viewing the details of the components (Jarl Objects) used to generate the frame check the "Show Object Tree" checkbox and then render a frame. Note, an Object Tree will only be generated at parse time. Therefore, if you've already been viewing an animation, and haven't made any changes, an Object Tree won't be rendered. Conversely, every time you make a change to the animation by editing the xml file, and you have the Object Tree check box checked, a new Object Tree will be displayed.
  •  
  • After playing around with the over 50 examples provided, you'll proably want to start branching out on your own. You can either modify an existing example, or copy one to use as a template. At that point, modify the xml file in your favorite text-editor (preferabbly one that supports xml-schema for in place validation), and view the results in the GUI.
  •  
  • Next, you can render you animation as a series of images from inside the GUI with the 'Render Full Animation' button.
  •  
  • At this point you can 'preview' your animation with the "Preview rendered animation" button, or generate a full movie by following this link or this link for more details.
  •  

What does it take to create a Jarl2d Animation
  • Jarl2d uses four different types of 'building blocks' to generate an animation.
    • Widgets which are shapes like circles, squares, etc...
    • Traits which modify widgets with different paints, rotation, position, etc...
    • Strokes which modify how the widgets are drawn. You can think of a Stroke like a custom Pen.
    • Filters which are more CPU intensive transformations, like twirl, ripple, etc..
  •  
  • At a bare minimum, an animation only needs one Widget. And that's exactly where Example 1 starts. (However, it's a lot more fun to add custom traits, and other objects to an animation.) Other than the types of objects, the other fundamental concept in Jarl2d is that it produces animations. Not just static pictures. This implies that things change. They can move from one side of the screen to the next. They can change colors, rotate, appear, dissapear and reappear at some later time. With that in mind, every Jarl2d object is designed to be able to change over time.
  •  
  • If you take a look a look at the Position Trait , which is one the traits that can move a widget around the screen, you'll see that it has one primary attribute: Pos. This is a pair of percentages relative to the screen that tell Jarl2d where to place the widget. For instance "50%, 50%" would place the widget in the center of the screen and "80%, 80%" would place the widget in the lower right hand corner of the screen. But if you want the widget to move, you will use the startPos and endPos attributes, and the Jarl2d engine will interpolate the widgets position of the lifetime of the widget. (More on 'lifetimes' in the next section). Similarly, nearly every single Jarl2d object has attributes that can change over time. There's even an advanced feature that allows you to control changes on a more fine-grained timescale. For instance, if you want to use the Position Trait to move a widget around the perimeter of the screen you would break up the startPos and endPos into for different actions: 1) UpperLeft hand cornder to UpperRight hand corner. 2) UpperRight hand cornder to LowerRight corner, etc..., etc.. This can be accomplished with the segment node. For instance:

    <traitDef name="MoveAroundTheScreen" class="Position">

      <segment startTime="0%" endTime="25%" startPos="5%, 5%" endPos="95%, 5%"/>

      <segment startTime="25%" endTime="50%" startPos="95%, 5%" endPos="95%, 95%"/>

      <segment startTime="50%" endTime="75%" startPos="95%, 95%" endPos="5%, 95%"/>

      <segment startTime="75%" endTime="100%" startPos="5%, 95%" endPos="5%, 5%"/>

    </traitDef>

  •  

Timing
  • The timing of Jarl2d objects are controlled by a few factors:
    • The times specified for widget instances
    • The total rendering time for the animation
    • The Frames per Second attribute of the animation
  •  
  • Let's first take a look at the rendering block of a Jarl2d animation. Open up in a text editor example20.xml from the examples directory. Notice the line: <time startTime="0s" endTime="1s" framesPerSec="10"/> This specifies that this animation will only last for 1 second. Also, there will be 10 frames per second (10 is the default and not required) so if you rendered this animation, it would be comprised of 10 frames and last for 1 second. (Not much of animation huh? It's not supposed to be, it just generates the colorGuide.jpg which can be found in your root install directory.)
  •  
  • The more interesting aspect of timing is the timings of your widgets and Global Filters. Each widget is rendered for a specific set of times. If you still have example20.xml open you will see at the bottom this line: <widget widgetDef="colorBox" startTime="0s" endTime="1s" fill="true"/> This tells Jarl's RenderManager to render the widget defined by the name: 'colorBox' for exactly 1 second starting at time 0. (Actually, its for exactly 10 frames, but you get the idea.) Widgets can start at arbitrary startTimes and arbitrary endTimes (however, you should ensure that the end time is greater than the startTime.) Also, note that the times have a 's' appended. If you leave out this 's', the RenderManager will assume you are using absolute frame indices, and you might not get the desired results. For a really intense set of scheduled widgets, render a frame from examples/example36.xml, next go to the generated xml file at /gen/com/arranger/jarl/config/example36.xml and you'll see a few more entries. You might want to compare the generated xml file vs the original at examples/example36.xml.
  •  

SourceForge.net Logo
Home
Webmaster
Last Updated: Wednesday, April 30 -- 2003