Filename$ - Name of the file containing the model to load. Parent (optional) - Specify an entity to act as a Parent to the loaded mesh. |
dxLoadAnimMesh, similar to dxLoadMesh, Loads a mesh from an .X, .3DS or .B3D file and returns a mesh handle. The difference between dxLoadMesh and dxLoadAnimMesh is that any hierarchy and animation information present in the file is retained. You can then either activate the animation by using the dxAnimate command or find child entities within the hierarchy by using the FindChild(), dxGetChild() functions. The optional parent parameter allows you to specify a parent entity for the mesh so that when the parent is moved the child mesh will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent. Specifying a parent entity will still result in the mesh being created at position 0,0,0 rather than at the parent entity's position. |
; dxLoadAnimMesh Example ; -------------------- ; In this example we will demonstrate the use of the dxLoadAnimMesh command. ; Quite simply, we will load an anim mesh from file, dxAnimate it, and then view it. dxGraphics3D 640,480 dxSetBuffer dxBackBuffer() camera=dxCreateCamera() dxPositionEntity camera,0,20,-100 ; position camera so that robot will be in view when loaded light=dxCreateLight() dxRotateEntity light,90,0,0 ; Load anim mesh robot=dxLoadAnimMesh("media/makbot/mak_robotic.3ds") ; dxAnimate mesh - this will begin an animation sequence which is updated when dxUpdateWorld is called dxAnimate robot,2 While Not dxKeyDown(1) dxUpdateWorld ; Update anim - without this our anim mesh will freeze dxRenderWorld ; Render everything dxFlip ; Show everything Wend End |