In the room.dba demo, that comes with DB1.. can the camera controls be modified, so that it's possible to rotate the camera around the player?
I know it's going to be one of the camera rotation commands, but I don't know where, or how, to add in this extra bit of control.
I've copied out the camera function from the dba, here is the unedited source:
function handle_camera(px#,pz#,pa#)
rem Calc camera position and angle
ca#=wrapvalue(pa#+180.0)
cx#=newxvalue(px#,ca#,scdis#)
cz#=newzvalue(pz#,ca#,scdis#)
rem Record camera coords
oldx#=scx#
oldz#=scz#
rem Calc smoothed camera position and angle
diff#=(scx#-cx#)/6.0
scx#=scx#-diff#
diff#=(scz#-cz#)/6.0
scz#=scz#-diff#
sca#=curveangle(pa#,sca#,6.0)
rem Restrict camera if collide with walls
position object 103,scx#,-50,scz#
if object collision(103,5)=1
if object hit(103,5)=1 then cdis#=100.0
position object 103,scx#,-50,oldz#
if object collision(103,5)=0
scx#=oldx#
else
position object 103,oldx#,-50,scz#
if object collision(103,5)=0
scz#=oldz#
else
scx#=oldx#
scz#=oldz#
endif
endif
else
if cdis#500.0 then cdis#=500.0
endif
endif
rem Smooth camera distance for next cycle
diff#=(scdis#-cdis#)/6.0
scdis#=scdis#-diff#
rem Set camera
position camera scx#,-50,scz#
point camera object position x(101),object position y(101)-100,object position z(101)
endfunction
I want to keep the effect, where the camera flows into a 3rd person position behind the player, along with the code that keeps it from going through walls.
The bit I need to snip out (that's if it stop the camera rotating properly), is the code that swings the camera into the 3rd spot.
Finally, adding the code that rotates the camera. Most of the original code won't need to be edited or removed at all, I'm just not sure where I should edit..
-------------------------------------------------
http://www.sepherion.co.uk/images/wufflez/Wufflez.jpg[/img]