Jump to content

SetCameraMatrix problem


redditing

Recommended Posts

So if i using function "setCameraMatrix" then i can't rotation it. For example i want set camera in one point and turn it 90 degrees in left but i can't pls help!

 

function DropCamera(player, command)
	local x, y, z = getElementPosition(player)

	setCameraMatrix(player, x, y, z+1.5, 0, 0, 90, 0, 0)
end

addCommandHandler("setcamera", DropCamera)

 

Link to comment
  • Moderators
1 hour ago, redditing said:

So if i using function "setCameraMatrix" then i can't rotation it. For example i want set camera in one point and turn it 90 degrees in left but i can't pls help!

 



function DropCamera(player, command)
	local x, y, z = getElementPosition(player)

	setCameraMatrix(player, x, y, z+1.5, 0, 0, 90, 0, 0)
end

addCommandHandler("setcamera", DropCamera)

 

 

Like this:

local cam = getCamera()

local rx, ry, rz = getElementRotation(cam)

--[[
rx, ry, rz -- transformations
]]

setElementRotation(cam, rx, ry, rz)

 

Edited by IIYAMA
  • Thanks 1
Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...