- Documentation
- Client functions
- setCameraRenderMatrix
Function
setCameraRenderMatrix
Places the camera like setCameraMatrix: the position, the point it looks at, roll and field of view (5-170, 70 by default). It detaches the camera from an element.
Syntax
bool setCameraRenderMatrix(element camera, float x, y, z, float lx, ly, lz [, float roll = 0, float fov = 70])Arguments
cameraelement- The camera.
x, y, zfloat- Position.
lx, ly, lzfloat- The point it looks at.
rollfloat, optional = 0- Roll in degrees (positive = to the right).
fovfloat, optional = 70- Field of view.
Returns
true on success.
Example
A top-down view of a junction.
local cam = createCameraRender(512, 512, 10)
setCameraRenderMatrix(cam, 1544, -1675, 60, 1544, -1674, 0, 0, 90)
See also
getCameraRenderMatrixReturns the camera placement: x, y, z, the target, roll and field of view. For a camera attached to an element it gives the spot of the last shot.renderCameraMatrixTakes one shot from the given spot (likesetCameraRenderMatrixandupdateCameraRenderat once). The image appears in the texture 1-2 frames later; it also works at 0 shots per second.attachCameraRenderAttaches the camera to an element (a vehicle, a player, a ped, an object, a model object). The position and target are in metres in the element's frame (x right, y forward, z up); the target defaults to 10 m in front of the camera. A rear-view mirror is a camera at the back of the car looking backwards plussetCameraRenderMirrored.