// note: this example should work with AGK 108.21 onward and AGK V2 // use the wasd keys or the on screen joystick // to rotate the box about its local X and Y axis // create a direction light and a box to rotate (the light just makes it easier to see the box) // the box will automatically be positioned at 0,0,0 CreateLightDirectional(1,-1,-1,1,255,255,0) createObjectBox(1,10,10,50) // position the light away from the box and then make the camera look at where the box is SetCameraPosition(1,0,0,-200) SetCameraLookAt(1,0,0,0,0) // main loop do // player input using the joystick commands so this demo will work on a keyboard or a touch screen joystick_x = GetJoystickX() joystick_y = GetJoystickY() // rotate the box using the saved input values RotateObjectLocalY(1,joystick_x) RotateObjectLocalX(1,joystick_y) // print the box's angles to the screen print(getObjectAngleX(1)) print(getObjectAngleY(1)) print(getObjectAngleY(1)) sync() loop