i have found a funny animated robot (3ds file) in several freeware libraries for blitz3d , so i have converted it to directX "*.x" file using 3ds max with the Panda DirectX Exporter from
you can download the model 3ds file, and directx file, textures, code from here (231 KB)
Code: Select all
Global xres=640, yres=480
MP_Graphics3D (xres,yres,0,3)
SetWindowTitle(0, "animated sporty robots")
;MP_Wireframe(1)
camera=MP_CreateCamera()
light = MP_CreateLight(2)
light2 = MP_CreateLight(2)
MP_LightSetColor (light, RGB(255,255,255))
;MP_InitShadow()
Width=256
Height=256
robot = MP_LoadAnimMesh("mak4.x")
robot2 = MP_LoadAnimMesh("mak4.x")
robot3 = MP_LoadAnimMesh("mak_boss.x")
MP_ScaleEntity(robot,0.1,0.1,0.1)
MP_ScaleEntity(robot2,0.05,0.05,0.05)
MP_ScaleEntity(robot3,0.03,0.03,0.03)
MP_PositionEntity(robot,0,0,-3)
MP_PositionEntity(robot2,-3,0,-3)
texture3 = MP_CreateTextureColor(256, 256, RGBA(2, 100, 230, 1))
sphere = MP_CreateSphere(30)
MP_EntitySetColor(sphere,RGB(255,255,0))
MP_ScaleMesh(sphere,0.3,0.3,0.3)
;cone = MP_CreateCone(64, 10)
teapot = MP_CreateTeapot()
MP_EntitySetColor(teapot,RGB(0,255,0))
MP_PositionEntity(teapot, 0, 1, 0)
MP_ScaleMesh(teapot, 1, 1, 1)
MP_RotateEntity(teapot, 0, 0, 0)
plane = MP_CreatePlane(24, 24)
MP_PositionEntity(plane, 0, 0, 0)
MP_EntitySetTexture(plane, texture3)
MP_RotateEntity(plane, 0, 90, 90)
MP_PositionCamera(camera, 10, 6, 6)
MP_CameraLookAt(camera,0,0,0)
;MP_PositionEntity(light, 0, 10, 20)
MP_EntityLookAt(light,0,0,0)
MP_PositionEntity(light2, 10, 5, 10)
MP_LightSetColor (light2, RGB(255,255,255))
x.f : y.f = 2.5 :z.f: x2.f: y2.f = 2.5: z2.f: angle2.f = 40
x3.f: y3.f = 2.5: z3.f: angle3.f = 70
While Not MP_KeyDown(#PB_Key_Escape) And Not WindowEvent() = #PB_Event_CloseWindow
angle.f + 0.7
angle2 + 0.7
angle3 + 0.7
x = Cos(Radian(angle)) * 3: z = Sin(Radian(angle)) * 3
x2 = Cos(Radian(angle2)) * 3: z2 = Sin(Radian(angle2)) * 3
x3 = Cos(Radian(angle3)) * 3: z3 = Sin(Radian(angle3)) * 3
MP_PositionEntity(light, x , y, z)
MP_PositionEntity(sphere, x , y, z)
MP_PositionEntity(robot, x , 0, z)
MP_PositionEntity(robot2, x2 , 0, z2)
MP_PositionEntity(robot3, x3 , 0, z3)
;to turn the robots so its face will be the same as the
;tangent to the circle circumference (the robots orbit)
MP_RotateEntity(robot, 0, -90, -angle)
MP_RotateEntity(robot2, 0, -90, -angle2)
MP_RotateEntity(robot3, 0, -90, -angle3)
MP_EntityLookAt(light,0,0,0)
MP_RenderWorld()
MP_Flip ()
Wend