140 likes | 157 Views
Entity Animation and 3D Math. LoadAnimSeq SetAnimKey AddAnimSeq ExtractAnimSeq Animate SetAnimTime AnimSeq AnimLength AnimTime Animating. Entity Animation. LoadAnimSeq. LoadAnimSeq( Model, fileName$ ). Example Code: Model = LoadAnimMesh(“Model.b3d”)
E N D
LoadAnimSeq • SetAnimKey • AddAnimSeq • ExtractAnimSeq • Animate • SetAnimTime • AnimSeq • AnimLength • AnimTime • Animating Entity Animation
LoadAnimSeq LoadAnimSeq( Model, fileName$ ) Example Code: Model = LoadAnimMesh(“Model.b3d”) WalkAnimation = LoadAnimSeq(Model,”Walk.b3d”)
Animate Animate model[,mode][,speed#][,sequence][,transition#] Example Code: Model = LoadAnimMesh(“Model.b3d”) WalkAnimation = LoadAnimSeq(Model,”Walk.b3d”) Animate Model or Animate Model,3,1,WalkAnimation,0
SetAnimTime SetAnimTime model, time#[,animationSeq] Use: You can make a time loop in your code to manually animate a model.
AnimTime AnimTime# (model) Use: Returns the current time of the animation
AnimLength AnimLength (model) Use: Returns the length of the current animation Problem: You must be playing the animation
AnimSeq AnimSeq( model ) Use: This function can be used to check if the current animation sequence is playing or has been played last. Problem: If your animation sequence stops playing, the AnimSeq still returns that sequence (can’t check if it is still in play)
Animating Animating( model ) Use: This function can be used to check if the current model is animating Combine this w/ AnimSeq to check if a particular animation sequence has stopped playing
SetAnimKey SetAnimKey model, frame Use: If you have a number of animations and you want to record them or create a new animation using the current few that you have
AddAnimSeq AddAnimSeq (model, length) Use: When you are done setting the animation keys, you can use this command to put what you recorded into an animation to play back later. Example: For frame=1 To 10 SetAnimKey model, frame Next AnimSequence = AddAnimSeq(model,frame-1)
ExtractAnimSeq ExtractAnimSeq(model,first_frame,last_frame) Use: If you have a animation that has multiple animations in it such as walk, run, idle. You can use this command to break up the original animation into multiple sequences Example: model = LoadAnimMesh(filename$) walkAnimSeq = ExtractAnimSeq( model, 0, 30) idleAnimSeq = ExtractAnimSeq( model, 31, 40) Animate model,1,1,idleAnimSeq
3D Math • VectorYaw • VectorPitch
VectorYaw VectorYaw# (x#, y#, z#) Returns the yaw value of a vector VectorPitch VectorPitch# (x#, y#, z#) Returns the pitch value of a vector