[b][/b]
Just a little Routine I use to control camera, It saves rewriting it everytime, I do not like the built in routine "Control Camera with Arrowkeys" is too limited
ink RGB(0,0,0),RGB(255,0,0)
color backdrop RGB(0,0,120)
set ambient light 50
sync on
sync rate 60
make object plain 1, 100,100
color object 1, RGB(0,128,0)
do
IF SCANCODE() then PositionCamera()
sync
loop
Function PositionCamera()
remstart
used to control camera
Insert before a sync as follows
IF SCANCODE() then PositionCamera()
UpArrow = Forward, DownArrow = Backward
Left and right arrows turn
Pageup = Up
PageDown = Down
Home = Tilt Camera Down
End = Tilt Camera Up
Shift key reduce speed
remend
IF CONTROLKEY()THEN MyChange = 20 Else MyChange = 5
IF SHIFTKEY() THEN MyChange = 1 Else MyChange = 5
IF UPKEY()
TEMPXANG = CAMERA ANGLE X(0)
XROTATE CAMERA 0, 0
MOVE CAMERA 0, 2 * MyChange
XROTATE CAMERA 0, TEMPXANG
ENDIF
IF DOWNKEY()
TEMPXANG = CAMERA ANGLE X(0)
XROTATE CAMERA 0, 0
MOVE CAMERA 0, -2 * MyChange
XROTATE CAMERA 0, TEMPXANG
ENDIF
IF LEFTKEY() then yrotate camera 0, camera angle y (0) -1
IF RIGHTKEY() then yrotate camera 0, camera angle y (0) +1
IF KEYSTATE (207) THEN xrotate camera 0, camera angle x (0) -.5
IF KEYSTATE (199) THEN xrotate camera 0, camera angle x (0) +.5
IF KEYSTATE (201) THEN POSITION CAMERA 0,Camera position x(0),Camera position y(0)+MyChange, Camera position z(0)
IF KEYSTATE (209) THEN POSITION CAMERA 0,Camera position x(0),Camera position y(0)-MyChange, Camera position z(0)
IF KEYSTATE (210) THEN Xrotate camera 0, 0
EndFunction
Use it, Abuse it as you will, If you have a better routine please share
System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX