TGC Codebase Backup



AGK spinning cube example by Markus

10th Feb 2013 15:54
Summary

spinning red cube my first 3d program trying the 3d part in agk. using a camera,creating a red cube,make a directional light, rotating the cube around y axis in front of camera.



Description

my first 3d program trying the 3d part in agk.
using a camera,creating a red cube,make a directional light,
rotating the cube around y axis in front of camera.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    rem
rem AGK Application
rem

rem Landscape App
SetDisplayAspect( 4.0/3.0 )

cameraID=1
SetCameraRange( cameraID, 1, 1000 )
SetCameraPosition( cameraID, 0,1.68,0 )
SetCameraLookAt( cameraID, 0, 0, 5, 0 )

lightID=1
CreateLightDirectional( lightID, 0, -1, 1, 255, 255, 255 )

iBox=CreateObjectBox( 1, 1, 1 )
SetObjectPosition( iBox, 0, 0.5, 5 )
SetObjectCollisionMode( iBox, 1 )
SetObjectColor( iBox, 255, 0, 0, 192 )

do
 Print("hello 3d world")
 print(screenfps())
 amount#=360.0/60.0
 RotateObjectLocalY( iBox, amount# )

 Sync()
loop