SET CAMERA TO OBJECT ORIENTATION This command will set the camera to the same direction as the specified 3D object.
Syntax
    SET CAMERA TO OBJECT ORIENTATION Object Number
    SET CAMERA TO OBJECT ORIENTATION Camera Number, Object Number
Parameters
    Camera Number
Integer The camera number
    Object Number
Integer The object number
Returns
This command does not return a value.
Description
The object number must be an integer value.
Example Code
    autocam on

    make matrix 1,4000,4000,100,100

    set matrix height 1,50,50,500

    update matrix 1

    make object sphere 1,10

    set camera rotation xyz 0

    set camera range 0,1,3000

    while mouseclick()<>1

    a#=a#+1 : if a#>359 then a#=a#-360

    x#=500+(cos(a#)*100) : z#=500+(sin(a#)*500)

    distance#=200.0 : height#=100.0 : smooth#=25.0

    dx#=x#-camera position x(0):dz#=z#-camera position z(0)

    angle#=atanfull(dx#,dz#)

    set camera to follow 0,x#,0,z#,angle#,distance#,height#,smooth#,0

    set camera to object orientation 0,1

    endwhile

    while mouseclick()=1 : endwhile

    delete matrix 1

    autocam off

    end
See also
CAMERA Commands Menu Index