Quote: "For some form of intro, although I've never done it, I would be tempted to start with a hidden cube and attach the camera to it with Set Camera To Follow."
That's a pretty good idea TDK. Keeping it all in DBC without having to rack one's brain on the maths. Nice!
Quote: "2) Set a target camera zoom by either changing FOV or just moving the camera back on the z axis (assuming you're facing so that x is left/right, y is up/down)."
Makes sense Demon's Breath.
So I couldn't resist. I mainly typed this up for myself so I was sure I understood or at least think I understand the concept. Combining TDKs and Demons Breaths ideas, here's a Smash Bro's-esque camera. The cube in the center is TDK's focus cube. If the cones move out of screen then the camera pulls back. If they are all in screen, the camera moves forward. The cube is positioned based on the average of all the cone's positions so it's always in the center. The camera follows the cube. Change the set camera to follow settings to increase or decrease the lag.
I tried it using field of view as well, but the effect wasn't as good as just moving the camera physically closer or farther away.
set display mode 800,600,16
sync on
sync rate 60
autocam off
hide mouse
randomize timer()
rem make a matrix for reference
make matrix 1,1000,1000,25,25
position matrix 1,-500,0,-500
rem make four cones that'll move around on screen
dim objspeed#(4,2)
for obj=1 to 4
make object cone obj,50
position object obj,rnd(300)-150,rnd(500),0
objspeed#(obj,1)=rnd(10)-5
objspeed#(obj,2)=rnd(10)-5
next obj
rem make a single cube object for the camera to follow
focus=5
make object cube focus,25
rem field of view
fov#=3.14/2.905
camdist#=100
do
gosub _move_objects
sync
loop
_move_objects:
avx#=0
avy#=0
rem loop through each player object
for obj=1 to 4
objx#=object position x(obj)
objy#=object position y(obj)
`objz#=object position z(obj)
rem if the x or the y position are out of bounds
rem reverse the direction
if objx# < -500 or objx# > 500
objspeed#(obj,1)=0.0-objspeed#(obj,1)
endif
if objy# < 0 or objy# > 500
objspeed#(obj,2)=0.0-objspeed#(obj,2)
endif
position object obj,objx#+objspeed#(obj,1),objy#+objspeed#(obj,2),0
rem increase avx# and avy# to position the fucus cube appropriately
inc avx#,object position x(obj)
inc avy#,object position y(obj)
next obj
rem position the focus cube in the center of all 4 objects
avx#=avx#/4.0 : avy#=avy#/4.0
position object focus,avx#,avy#,0
rem change the camera distance if objects are in screen
if object in screen(1) and object in screen(2) and object in screen(3) and object in screen(4)
dec camdist#,10
else
inc camdist#,100
`camdist#=curvevalue(camdist#+100,camdist#,20)
endif
rem set camera to follow focus
set camera to follow avx#,avy#,0,0,camdist#,avy#,50,0
rem change the field of view if all four objects are in screen
`if object in screen(1) and object in screen(2) and object in screen(3) and object in screen(4)
` dec fov#,.01
`else
` inc fov#,.01
`endif
`set camera fov fov#
return
Enjoy your day.