Skip to content
This repository was archived by the owner on Sep 5, 2026. It is now read-only.

3. Basic animation

Ercan Akyürek edited this page Feb 16, 2015 · 5 revisions

Introduction

In this chapter, I am going to teach you, how to create very fast, powerful animations. With powerful I mean basics.

Understanding animations

There are multiple ways how to animate object with NoLimitsFramework.

Animation class

I would suggest to use the com.NoLimitsFramework.animation.Animatation class (hint: import com.NoLimitsFramework.animation.*). The constructor of the Animatation class accepts a query string. At this moment, only Scenery query is accepted. Queries are easy to use. If you want to crawl a scenery object which is placed in your NoLimits Editor and for example labeled Cube then your query should look like: Scenery: Cube. If you want to crawl an object inside your cube (for example if you have a 3ds file with multiple nodes) you can use such a query: Scenery: Cube, Cube1.

So lets instantiate an animation object.

Animation CubeAnimation = new Animation("Scenery: Cube"); 

Now, we are able to define a transition. For this purpose, the Animation class provides an important method called addAnimation(PropertyToAnimate, NewValue, StartTime, EndTime, Easing).

Let me explain the arguments for addAnimation.

  • PropertyToAnimate: What do we want to animate? The position, scale, rotation, etc. I am going to make an API for NoLimitsFramework where you can catch the possible options.

  • NewValue: The new value of the property

  • StartTime: If you want only one animation, just use 0.0f for beginning on the 0nd second.

  • EndTime: I guess you might know what this argument does

  • Easing: This is an interesting topic. I am going to write a wiki article, especially for easing. At this time you can look at the easings on this website: http://easings.net/en. Almost all of them are implemented. I am quoting the explanation on easings.net what easings actually are:

Easing functions specify the rate of change of a parameter over time. Objects in real life don’t just start and stop instantly, and almost never move at a constant speed. When we open a drawer, we first move it quickly, and slow it down as it comes out. Drop something on the floor, and it will first accelerate downwards, and then bounce back up after hitting the floor.

Clone this wiki locally