Can anyone please explain the use of the ANIM, KEYS, and BONE chunks in the b3d file format?
Thanks.
Thanks.
ANIM CHUNK flags frames fps END ANIM NODE CHUNK name$ position x,y,z scale x,y,z rotation quat w,x,y,z BONE CHUNK for each vert affected by this BONE the verts ID the verts weight (this bones influence on this vert) next vert END BONE // this bones KEYS KEYS CHUNK // flags tells us what key types are expected flags (1=position + 2=scale + 4=rotation) for each keyframe keyframe time position x,y,z scale x,y,z rotation quat w,x,y,z next keyframe END KEYS // next NODE....(next child bone)..
TEXS Chunk BRUS Chunk ROOT NODE (the mothernode!:) | +-MESH Chunk | | | |-VRTS Chunk | |-TRIS Chunk | +-ANIM | +-NODE (pelvis) | | | |-BONE | |-KEYS | | | +-NODE (waist) | | | | | |-BONE | | |-KEYS | | | | | +-NODE (chest) | | | | | |-BONE | | |-KEYS | | | +-NODE (right_thigh) | | | |-BONE | |-KEYS | | | | ...right_shin and so on
;;;;;;;;;;;;;;;;; ; Write B3D ; ;;;;;;;;;;;;;;;;; Function WriteBB3D( f_name$,mesh ) m1 = mesh file=WriteFile( f_name$ ) b3dSetFile( file ) ;Begine B3D Main Chunk.......................M\ b3dBeginChunk( "BB3D" ) b3dWriteInt( 1 );version WriteBRUS( );Texture & Brush ;HERE WE GO...............................? If keyframes>1 m1=nextchild(m1) End If If m1 Repeat b3dBeginChunk( "NODE" );Chunk WriteNODE( m1 );node WriteANIM( m1 );anim Mesh_Bone_Pivot( m1 );Whats' Node Type [M/B]?? WriteKEYS( m1 );keys WriteHierarchy( m1 );Hier m1 = NextChild(m1) If Not m1 Exit Forever EndIf If openfiles>0 For c=1 To openfiles b3dEndChunk() Next End If ;End B3D Main Chunk...........................M/ b3dEndChunk() ;END B3D CloseFile file openfiles=0 End Function