*m | Pointer to motion structure |
*obj | Pointer to object structure |
spline_flag | Spline attribute flag (0: linear and 1:spline) |
#include <Shinobi.h> #define OBJECT object_sample #define MOTION motion_sample #define LINEAR 0 #define SPLINE 1 extern NJS_MOTION MOTION[]; extern NJS_OBJECT OBJECT[]; Float ff = 0.f; Int spline_flg = SPLINE; : Sint32 njUserMain(void) { : njSetCurrentMotion(MOTION, ff ); PushPopMotion( OBJECT ); ff+=0.2f; if( ff >= (MOTION->nbFrame-1) ) ff=0.f; : } PushPopMotion(NJS_OBJECT *obj) { njPushMatrix( NULL ); /* Draw picture of model */ if( obj->model != NULL ) njDrawModel( obj->model ); if( obj->child != NULL ) PushPopMotion( (NJS_OBJECT*)obj->child ); njPopMatrix( 1 ); if( obj->sibling != NULL ) PushPopMotion( (NJS_OBJECT*)obj->sibling ); } :