pepsi18 Posted May 4, 2015 Share Posted May 4, 2015 Hello everyone I wonder what functions should be used to achieve an effect similar the plane cam of GTA V Link to comment
MTA Team botder Posted May 4, 2015 MTA Team Share Posted May 4, 2015 viewtopic.php?p=721951#p721951 Link to comment
pepsi18 Posted May 5, 2015 Author Share Posted May 5, 2015 Thanks helped me alot but I have a problem is possible when the mouse is rotate also rotate the camera ? function camera () local theVehicle = getPedOccupiedVehicle(localPlayer) if (not theVehicle or isPedDead(localPlayer)) then return end local eM = getElementMatrix( theVehicle ) local vx, vy, vz = getElementVelocity( theVehicle ) local speed = math.sqrt(math.pow(vx, 2) + math.pow(vy, 2) + math.pow(vz, 2)) + 0.5 local distance = 5 * speed + 10 local heightAboveVehicle = 5 local roll = math.deg(math.atan2(eM[1][3], eM[3][3])) local x = -distance * eM[2][1] + eM[4][1] local y = -distance * eM[2][2] + eM[4][2] local z = -distance * eM[2][3] + heightAboveVehicle * eM[3][3] + eM[4][3] local lx = 4 * eM[2][1] + eM[4][1] local ly = 4 * eM[2][2] + eM[4][2] local lz = 4 * eM[2][3] + eM[4][3] if getCameraViewMode ( ) == 2 then setCameraMatrix( x, y, z, lx, ly, lz, roll) end end Link to comment
MTA Team botder Posted May 6, 2015 MTA Team Share Posted May 6, 2015 That requires more work and MATHS. You can use a clientside event when the cursor moves to change the degree around the hydra. Not going to explain that Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now