Sign in to follow this  

CameraMatrix rotation

Recommended Posts

Hi all, i needed to be create a camera rotation function, i created something like that:

local camX = cctv.camlx - math.cos(localC.angle / cctv.camlx) * 30

local camY = cctv.camly - math.sin(localC.angle / cctv.camly) * 30

setCameraMatrix(cctv.camx,cctv.camy,cctv.camz,camX,camY,cctv.camlz - localC.height,0,localC.fov)* -- camera position

cctv.caml* -- camera look position

localC.angle -- rotation angle

Depending on rotation of the camera, this script is working, or does not work, when you call the camera does not look at the specified coordinates and rotates each time on a different angle in spite of the specified range (from -40 to 40).

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.