Camera Rotation

Blitz3D Forums/Blitz3D Beginners Area/Camera Rotation

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

If it's a chase style camera you could try something like this ... or look up the car demo in the samples directory.

;initialise
global target = createpivot( character )
positionentity target,0,0,-10
global camera = createcamera()
global smooth# = .05

function chase_camera()

  dx# = ( entityx(target,1) - entityx(camera) ) * smooth
  dy# = ( entityy(target,1) - entityy(camera) ) * smooth
  dz# = ( entityz(target,1) - entityz(camera) ) * smooth
  pointentity camera,character
  transalateentity camera,dx,dy,dz

end function