Fixed the 'bugs'.
With it, you can examine your 3D models and see how they look.
Rotates 3d model along it's x and y axis, and you can zoom in and out.
Works on PC.
Simply load your own 3D object on line 44 in the code snippet below. (in place of the 'BOX' object) ....and you should be able to view it o.k.
// Project: 3D Object VIewer
// Created: 2019-09-08
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "AGK Object Viewer" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
Box = CreateObjectBox( 7,7, 11 )
`Or load your own object with : Box = LoadObject("My object.obj")
sync()
AddVirtualJoystick( 1, 945,100, 150 )
do
Gosub Move_Object
print ("Use 'mouse wheel' to zoom object in and out")
print ("Use 'Virtual Joystick' to move the object to different angles")
Sync()
loop
Move_Object:
`Virtual Joystick:
If GetVirtualJoystickY(1) < 0 `RotateObjectLocalX
RotateObjectLocalX( Box, 2 )
endif
If GetVirtualJoystickY(1) > 0
RotateObjectLocalX( Box, -2 )
endif
If GetVirtualJoystickX(1) > 0 `RotateObjectLocalY
RotateObjectLocalY( Box, -2 )
endif
If GetVirtualJoystickX(1) < 0
RotateObjectLocalY( Box, 2 )
endif
`Mouse Wheel:
if GetRawMouseWheelDelta() <0 then MoveCameraLocalZ(1,- 3)
if GetRawMouseWheelDelta() >0 then MoveCameraLocalZ(1, 3)
SetCameraLookAt( 1, GetObjectX(Box), GetObjectY(Box), GetObjectZ(Box), 0 )
Return