TGC Codebase Backup



Simple Camera movement by MikeS

16th Nov 2003 15:58
Summary

Simple way to move around and explore worlds with camera.(Includes FPS, and Polygon count)



Description

Simple way to move around and explore worlds with camera. (Non-tested for dbc) If you want, you can even go further by testing it out with the 'automatic camera collision' command in your own 3D world. Hope this helps!



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    sync on:sync rate 60
make matrix 1,1000,1000,10,10
randomize matrix 1,15
update matrix 1

do
set cursor 0,0
print "FPS" : print screen fps()
print "Polygons" : print statistic(1)

`controls
   if upkey() then move camera 1
   if downkey() then move camera -1
   if leftkey() then turn camera left 1
   if rightkey() then turn camera right 1
   if shiftkey()
      pitch camera up 90
      move camera 1
      pitch camera down 90
   endIf
   if controlkey()
      pitch camera up 90
      move camera -1
      pitch camera down 90
   endIf
 sync



 loop