Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 17 in printed book and digital formats -- plus a one-year subscription (beginning with 18.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 3.2

COLUMN

Path and Character Animation

Combine Both Libraries

Issue: 3.2 (November/December 2004)
Author: Joe Nastasi
Author Bio: Joe Nastasi is the president of Pyramid Design, a software development firm and the developers of A-OK! The Wings of Mercury and FTP Suite.
Article Description: No description available.
Article Length (in bytes): 7,709
Starting Page Number: 38
Article Number: 3218
Related Link(s): None

Excerpt of article text...

In the last eight issues, we've created two basic libraries that handle both pose and path animation. In this issue, we'll tie things up by demonstrating how to use the libraries together to create automated 3D models for your application. But first, we'll discuss an improvement to the PathAnimationClass Update method.

PathAnimationClass.Update

The state machine that we originally implemented was created using the Select statement to decide which state to execute. This is a good method if the Update method was being called as fast as possible, but it is being called at a fixed interval by a timer. When executing a path containing integrated turns (where the turning and moving are happening at the same time), there was a delay every time it was time to execute the Turn state.

Now the Update method uses an If-Then statement to test for each state. In the case of integrated turns, the code for the Turn state executes the NextState method which changes to the Move state. Control gets passed to the next If-Then statement which tests for the Move state. Since the next state is now Move, we start to execute the Move state logic in the same period, not the next one. This eliminates the delay.

Methodology

...End of Excerpt. Please purchase the magazine to read the full article.