It is good to hear that people might be interested in this
Quote: "Could EZRotate help me plot Long/Lat on a sphere?"
I would think so. I'm not sure exactly waht you are trying to do though...
I have the first three examples of EnAn ported to GDK now. They are all working really well. Here is what the source looks like for the first example:
//Enhanced Animations for The Game Creators GDK
//Example 1: The Basics
//---------------------------------------------
//by: Ron Erickson 22-Oct-07
#include "DarkGDK.h"
#include "EnhancedAnimations.h"
void DarkGDK ( void )
{
// **********************
// Setup
// **********************
dbSyncOn ( );
dbSyncRate (0);
dbBackdropOn ( );
dbAutoCamOff ( );
dbMaximiseWindow( );
dbSetWindowOff( );
dbSetDisplayMode( 1024, 768, 32 );
// **********************
// Load Objects:
// **********************
// Load Character Model
// ---------------------------------------------
dbLoadObject( "media/ai.x", 1 );
dbYRotateObject( 1, 180 );
dbFixObjectPivot( 1 );
dbLoadImage( "media/ai_D2.DDS", 1 );
dbTextureObject( 1, 1 );
// Camera
// ---------------------------------------------
dbPositionCamera( 35, 65, 100 );
dbPointCamera( 0, 45, 0);
// Set the default animation play speed (frames per second)
// ----------------------------------------------------------
EnAn_SetDefaultPlaySpeed( 15.0f );
// EXTRACT ANIMATION DATA FROM MODEL
// ************************************************
// Normaly, this would be done outside of your game as you are preparing your media.
// Extracting animations pulls the animation data out of your files
// and puts it into it's own file format
// Note: if you set the EndFrame# variable to -1, it will use the last frame in the model
EnAn_ObjExtractAnimation( 1, "Run.anim", 300, 318 );
EnAn_ObjExtractAnimation( 1, "Walk.anim", 235, 259 );
EnAn_ObjExtractAnimation( 1, "Pose.anim", 0, 0 );
// LOAD ANIMATIONS
// ************************************************
// This will load the animations that you extracted above
// The "AnimID" variable is what will be used to refer to your loaded animation
DWORD PoseAnim = EnAn_AnimLoad("Pose.anim");
DWORD WalkAnim = EnAn_AnimLoad("Walk.anim");
DWORD RunAnim = EnAn_AnimLoad("Run.anim");
// CREATE OAC LINK TO OBJECT
// ************************************************
// This will allow you to apply animations to an object. It provides the object with all of the
// internal variables that are needed for control.
// The "oacID" variable is what will be used to work with that particular DBpro object
// Each DBpro object that you want to control with Enhanced Animations will need an oacID
DWORD oacID = EnAn_oacCreate( 1 );
// PLAY THE WALK ANIMATION
// ************************************************
// This command will begin playing the Walk animation on the object.
// The oacID refers to the object that it is linked to.
// The Limb variable will apply the animation to the specified limb. Enhanced Animations can play animations
// on entire objects OR specific limbs.
// The StartFrame and EndFrame parameters describe what is considered the beginning and end of the animation.
// If the EndFrame parameter is set to a negative number, then the last frame of the animation file will be used
// The current frame parameter describes what frame to begin playing on. If the loop parameter is set to one (1),
// then when the animation reaches the end frame, it will start over at the start frame.
// If the exChild (or Exclude child) parameter is set to one (1), then ONLY the specified limb will have the
// animation applied to it. Otherwise, the specified limb and all of it's children in the limb hierarchy will have
// the animation applied to it.
EnAn_oacPlayAnim( oacID, 1, WalkAnim, 1, 1, -1, 1, 0 );
// Get the current time value.
DWORD time = dbTimer();
DWORD elapsedTime = 0;
// **********************
// Main Loop:
// **********************
while ( LoopGDK ( ) )
{
if ( dbEscapeKey ( ) )
return;
//ELAPSED TIME
//*****************************************
// Get the amount of elspsed time since the last time check
elapsedTime = dbTimer() - time;
//Reset the time check
time = dbTimer();
//UPDATE THE OAC
//*****************************************
//This will update the object's animation by telling the object how much time has elapsed
EnAn_oacUpdate( oacID, elapsedTime );
//TRANSITION TO NEW ANIMATIONS
//*****************************************
//Using a transition animation work very similat to Playing an animation (as described above)
//The only difference is the addition of the TransTime parameter wich tells the object how long
//it should take for the transition from the currently playing animation to the new animation
//that you are transitioning to.
if (dbReturnKey() == 1)
{
//Transition to walk over 2 seconds
EnAn_oacAnimTransition( oacID, 1, WalkAnim, 0.0f, 0.0f, -1.0f, 2000, 1, 0 );
}
if (dbSpaceKey())
{
//Transition to run over 1 second
EnAn_oacAnimTransition( oacID, 1, RunAnim, 0.0f, 0.0f, -1.0f, 1000, 1, 0 );
}
if (dbShiftKey())
{
//Transition to pose over 1 second
EnAn_oacAnimTransition( oacID, 1, PoseAnim, 0.0f, 0.0f, -1.0f, 1000, 1, 0 );
}
dbText ( 0,0,dbStr(dbScreenFPS()) );
dbText ( 0,10, "Enhanced Animations for GDK" );
dbText ( 0,20, "Example 01: The Basics" );
dbText ( 0,30, "By: Ron Erickson" );
dbText ( 0,40, "visit: www.GameToolshed.com" );
dbText ( 0,50, "-------------------------------------------------------------------" );
dbText ( 0,60, " This example shows the basics of how Enhanced Animations works!" );
dbText ( 0,70, " Press ENTER to switch to Walk animation" );
dbText ( 0,80, " Press SPACE to switch to Run animation" );
dbText ( 0,90, " Press SHIFT to switch to POSE" );
dbText ( 0,100, "-------------------------------------------------------------------" );
if ( EnAn_oacGetLimbPlayAnimID(oacID, 1) == WalkAnim )
{
dbText ( 0,110, " Current Play animation: Walk" );
}
if ( EnAn_oacGetLimbPlayAnimID(oacID, 1) == RunAnim )
{
dbText ( 0,110, " Current Play animation: Run" );
}
if ( EnAn_oacGetLimbPlayAnimID(oacID, 1) == PoseAnim )
{
dbText ( 0,110, " Current Play animation: Pose" );
}
if (EnAn_oacGetLimbTransIsActive(oacID, 1) == 1 )
{
if ( EnAn_oacGetLimbTransAnimID(oacID, 1) == WalkAnim )
{
dbText ( 0,120, " Switching to: Walk " );
}
if ( EnAn_oacGetLimbTransAnimID(oacID, 1) == RunAnim )
{
dbText ( 0,120, " Switching to: Run" );
}
if ( EnAn_oacGetLimbTransAnimID(oacID, 1) == PoseAnim )
{
dbText ( 0,120, " Switching to: Pose" );
}
}
dbSync ( );
}
}
a.k.a WOLF!