Week 13

Keyframe Animation Theory

Every object in Raina3D currently has a single transformation node, which allows it to be translated, scaled, and rotated based on user- or file-input. To allow for animation, the transformation node will have to support transformation values for each spatial key frame. This can be done by moving the transformation information into a new object: Key. The Key object will contain the translation, rotation, and scaling values of the specific frame. Each Key object will be identified by its frame attribute. This allows the Transformation object to be cleaner by implementing a Key data structure, in the form of a vector or array and a reference to the current transform.

When a user selects to create a new key frame, the key is inserted into a sorted array of keyframes. By maintaining a constant sorted array of keyframes, adding a new key frame becomes a linear process. It searches for the first key that is greater than the selected frame and moves all the elements up one space.

It will be more difficult to dynamically set key frames AFTER changing the values because when the values are changed in the graphical user interface, they are saved into the current transform key. In traditional rendering software, if the user changes the value of the key, the application transforms the object based on the values, but when the user moves to another keyframe without setting the key, the object is interpolated based on the values among the keyframes that surround the frame.

To avoid this problem, I plan on implementing Create Key to create a key placeholder, which holds the transformation information of the keyframe before the new one. The user can then change the transforms to their likings.

 

Timeline

The Timer object that I created in Physics class can finally get a makeover. By implementing the QTimer object and a reference to the scene, the user can have direct control of the current frame. Rather than the previous DT (delta time), the new Timer object stores the current frame and frames per second. The current version stores the default value of 24 frames per second. In the future, I’ll build a widget that stores all of the timeline and timer attributes, such as start/end frames, frames per second…etc.

The graphical timeline is a QT widget that allows the user to take control of the animation’s position and speed. The current version of the graphical timeline allows the user to select the initial and final “viewable” frames. The timeline slider automatically adjusts to the range. This will be useful when a certain part of the animation is required. The play and stop buttons allow the user to view the animation. These buttons are linked to the Timer object which process the frames between the start and end frames.

 

Transformation Object

Using the Keyframe Animation theory, I “transformed” the Transformation object to house an array of Key objects with a reference to the current key. The current version is a backend approach where I hard-coded values to test the timer-transformation interface. I need to implement a Create Key button into the Edit Widget dialog to allow the user to set and edit key frames.

With the timeline connected to the scene, the new transformation takes place when the object calls its transform function, which in turn determines which transformation key has to be returned.

 

Keyframe Animation

I implemented Keyframe animation by apply the keyframe animation theory along with the timeline and the new transformation object. The transformations are based in linear interpolation. The user can create a key and update its transformation in the Edit Widget.

 

Load Animation

Keyframe animations can be loaded from the file. The old version parses objects with translate, rotate, and scale keywords. The new version reads "key #", which creates a key followed by the frame number. This creates / loads a transformation key frame. This is a primitive step to auto-load scenes with animation.

 

GLU Shapes

I changed the GLUT shapes structures to GLU quadrics to allow cleaner interaction with textures. New shapes include cylinder and disks.

 

Weekly Notes
Project-specific sections:

> Week 1 Notes
> Week 2 Notes
> Week 3 Notes
> Week 4 Notes
> Week 5 Notes
> Week 6 Notes
> Week 7 Notes
> Week 8 Notes
> Week 9 Notes
> Week 10 Notes
> Week 11 Notes
> Week 12 Notes
> Week 13 Notes
> Week 14 Notes
> Week 15 Notes
> Week 16 Notes
> Week 17 Notes
> Week 18 Notes
> Week 19 Notes
> Week 20 Notes

Home | About Raina3D | About Us | Thanks | Contact
Copyright (c) 2005-2009 Raina3D All rights reserved.