Jump to content

Camera Matrix


isa_Khamdan

Recommended Posts

addCommandHandler( "get", 
        function ( thePlayer ) 
                local x, y, z, x1, y1, z1 = getCameraMatrix ( thePlayer ) 
                outputChatBox(  x..","..y..","..z..","..x1..","..y1..","..z1 , thePlayer) 
        end 
) 

Link to comment
addCommandHandler( "get", 
        function ( thePlayer ) 
                local x, y, z, x1, y1, z1 = getCameraMatrix ( thePlayer ) 
                outputChatBox(  x..","..y..","..z..","..x1..","..y1..","..z1 , thePlayer) 
        end 
) 

Dosen't work :/

[19:04:11] ERROR: get\get.lua:8: attempt to concatenate local 'z1' (a nil value)

Link to comment

put this codes in client side

clientside:

addCommandHandler( "get", 
        function ( thePlayer ) 
                local x, y, z, x1, y1, z1 = getCameraMatrix ( thePlayer ) 
                outputChatBox(  x..","..y..","..z..","..x1..","..y1..","..z1 , thePlayer) 
        end 
) 

Link to comment

0 = N

90 = E

180 = S

270 = W

function findRotation(x1,y1,x2,y2) 
  local t = -math.deg(math.atan2(x2-x1,y2-y1)) 
  if t < 0 then t = t + 360 end; 
  return t; 
end 
  
addCommandHandler( "get", 
  function ( thePlayer ) 
    local x, y, z, x1, y1, z1 = getCameraMatrix ( thePlayer ) 
    local rx, ry, rz = findRotation(x, y, x1, y1) 
    outputChatBox(  rz, thePlayer) 
  end 
) 

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...