; A first look at 3D Graphics3D 640, 480 SetBuffer BackBuffer() ; a camera to look through, and a light to see by camera = CreateCamera() PositionEntity camera, 0, 3.5, -8 TurnEntity camera, 15, 0, 0 ; look down a little light = CreateLight() RotateEntity light, 50, 30, 0 ; the ground, a cube and a ball ground = CreatePlane() EntityColor ground, 80, 160, 80 cube = CreateCube() PositionEntity cube, -3, 1, 0 EntityColor cube, 255, 120, 60 ball = CreateSphere(24) EntityColor ball, 80, 160, 255 ; a ready-made character from the media folder, playing its "idle" animation hero = LoadAnimMesh("../../media/kenney/mini-characters/character-knight.glb") ScaleEntity hero, 3, 3, 3 PositionEntity hero, 3, 0, 0 TurnEntity hero, 0, 180, 0 Animate hero, 1, 1, FindAnimSeq(hero, "idle") While Not KeyHit(1) ; arrows walk the camera about If KeyDown(203) Then TurnEntity camera, 0, 2, 0 If KeyDown(205) Then TurnEntity camera, 0, -2, 0 If KeyDown(200) Then MoveEntity camera, 0, 0, 0.1 If KeyDown(208) Then MoveEntity camera, 0, 0, -0.1 TurnEntity cube, 1, 2, 0 ; spin the cube a little every frame PositionEntity ball, 0, 1 + Abs(Sin(MilliSecs() / 4)) * 2, 0 ; bounce the ball UpdateWorld ; animations (and physics, collisions) move on RenderWorld ; draw the 3D world from the camera Text 10, 10, "Arrows move the camera. Escape quits." Flip Wend End