@destroyer
I'm pretty sure he means he wants the camera to pan around the field, not just rotate and point somewhere else.
@May0naise
This could probably be done with trig, but here's a cheap trick I like to use for camera panning:
1.) Every loop, position the camera at 0,0,0 (or whereever you want it to pan around)
2.) Rotate the camera in whichever direction you want it to go.
3.) Use the command MOVE CAMERA and put in for the value however far away you want it to be multiplied by -1.
Example code:
Rem From TDK_Man's Tutorial On Menu Screens
Set Display Mode 800,600,32
Sync On: Sync Rate 60
GLOBAL CurDir$
GLOBAL Mx=MouseX()
GLOBAL My=MouseY()
GLOBAL Mc=MouseClick()
cd "Media"
LOAD IMAGE "MainMenu.jpg",1
LOAD IMAGE "StartButton.jpg",2
LOAD IMAGE "StartButton2.jpg",3
LOAD IMAGE "Hi-ScoreButton.jpg",4
LOAD IMAGE "Hi-ScoreButton2.jpg",5
LOAD IMAGE "ExitButton.jpg",6
LOAD IMAGE "ExitButton2.jpg",7
LOAD IMAGE "PongBack.jpg",8
Paste Image 1,0,0
Paste Image 2,245,186
Paste Image 4,245,338
Paste Image 6,245,490
Rem Main Menu (Highlighted Buttons)
Do
`check mouse position/click on each loop
Mx=MouseX()
My=MouseY()
Mc=MouseClick()
MainMenu:
Rem Start Button
If Mx > 245 and My > 186 And Mx < 566 And My < 242
PASTE IMAGE 3,245,186
If Mc=1 then gosub MainGame
ELSE
PASTE IMAGE 2,245,186
Endif
Rem Hi-Score Button
If Mx > 245 and My > 338 And Mx < 566 And My < 394
PASTE IMAGE 5,245,338
ELSE
PASTE IMAGE 4,245,338
Endif
Rem Exit Button
If Mx > 245 and My > 490 And Mx < 566 And My < 546
PASTE IMAGE 7,245,490
If Mc=1 then end
ELSE
PASTE IMAGE 6,245,490
Endif
Sync
Loop
MainGame:
cls
autocam off
position camera 0,0,30,30
point camera 0,0,0
sync on
sync rate 60
rem make "bumpers"
make object box 1,1,1,5
color object 1, rgb (255,255,255)
position object 1,13,0,p1pos#;
make object box 2,1,1,5
color object 2, rgb (255,255,255)
position object 2,-13,0,p2pos#;
rem make ball
make object sphere 3,1
color object 3, rgb (255,255,255)
rem make floor
make object box 4,30,0.1,30
position object 4,0,-0.55,0
rotate object 4,0,180,0
Texture Object 4, 8
`ADDED
CAMANGLEY=0
`/ADDED
do
`ADDED
position camera 0,0,0,0
inc CAMANGLEY
yrotate camera 0,wrapvalue(CAMANGLEY)
move camera -45
`/ADDED
rem Player 1 movements
if keystate(17)=1 and p1pos#<10
p1pos#=p1pos#+1
endif
if keystate(31)=1 and p1pos#>-10
p1pos#=p1pos#-1
endif
rem Player 2 Movements
if upkey()=1 and p2pos#<10
p2pos#=p2pos#+1
endif
if downkey()=1 and p2pos#>-10
p2pos#=p2pos#-1
endif
sync
loop
And of couse you can easily adjust the distance, speed of rotation, etc.