Hey, I threw this together this morning, but it isn't working, though it ALMOST is.
SYNC ON : SYNC RATE 0
Make Object Cylinder 1,1
Scale Object 1,100,100,500
Pitch Object Up 1,90
Fix Object Pivot 1
MAKE MATRIX 1,500,500,10,10
turn#=0
Pitch#=0
OffsetX#=1
OffsetY#=1
OffsetZ#=-1
DIM NORMAL#(3)
AUTOCAM OFF
MAKE OBJECT BOX 2,100,.1,.1
cOLOR OBJECT 2,RGB(255,0,0)
MAKE OBJECT BOX 3,.1,.1,100
COLOR OBJECT 3,RGB(0,0,255)
pOSITION OBJECT 2,CAMERA POSITION X(),0,CAMERA POSITION Z()
pOSITION OBJECT 3,CAMERA POSITION X(),0,CAMERA POSITION Z()
DO
IF UPKEY()=1 THEN MOVE CAMERA .1
IF DOWNKEY()=1 THEN MOVE CAMERA -.1
rotate camera 0,0,0
inc turn#,mousemoveX()
inc pitch#,mousemoveY()
Turn Camera Right turn#
Pitch Camera Down pitch#
CAMNORMAL()
x#=Camera Position X()
Y#=CAMERA POSITION Y()
Z#=CAMERA POSITION Z()
Position Object 1,x#+(NORMAL#(1))*OFFSETX#,Y#+(NORMAL#(2))*OFFSETY#,z#+(NORMAL#(3))*OFFSETZ#
SET OBJECT TO CAMERA ORIENTATION 1
TEXT 0,0,STR$(NORMAL#(1))
TEXT 0,50,STR$(NORMAL#(2))
TEXT 0,100,STR$(NORMAL#(3))
TEXT 0,150,STR$(CAMERA ANGLE X())
TEXT 0,200,STR$(CAMERA ANGLE Y())
TEXT 0,250,STR$(CAMERA ANGLE Z())
sync
LOOP
END
FUNCTION CamNormal()
NORMAL#(1)=cos(Camera Angle Y())
NORMAL#(2)=0-cos(Camera Angle X())
NORMAL#(3)=SIN(camera Angle Y())
ENDFUNCTION
Apart from not quite getting the x and z offsets right, the object angle X seems to randomly switch between positive and negative when rotating around the y axis for some reason.
Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose