Jump to content

lower camera angle?


KiffShark

Recommended Posts

Hi everybody

I want lower angle in players camera (vertical axxis).. I believe that default is 180(quasi) in the vertical axxis... from top to floor

And I'd like lower like 150... I don't know.. There is something that I can do?

and in horizontal axxis? 180º would be nice..

Thanks!!

(Sorry about my english D: )

Link to comment

I think the only solution would be to create a new camera handling system and that's a pretty advanced thing to do..

Check out the client function SetCameraMatrix

I think you could just update the camera matrix every 200 ms using a timer function and set X, Y, Z to the player position. But then you would also need to do some calculations because you don't want the camera inside the player. And then there's the handling of moving the mouse right and left for viewing controls...

As far as I know, there's no easy way to do this.

Link to comment
  • MTA Team
I think the only solution would be to create a new camera handling system and that's a pretty advanced thing to do..

Check out the client function SetCameraMatrix

I think you could just update the camera matrix every 200 ms using a timer function and set X, Y, Z to the player position. But then you would also need to do some calculations because you don't want the camera inside the player. And then there's the handling of moving the mouse right and left for viewing controls...

As far as I know, there's no easy way to do this.

Good try, but wrong. The camera would look very very annoying even at 50ms. The only way to do this is to use onClientPreRender.

Not tested, should work though.

Client-side

lower = true 
  
function lowerCamera() 
    local x, y, z = getElementPosition(localPlayer) 
    setCameraMatrix(x, y, z - 2, x, y, z) 
end 
  
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        addEventHandler("onClientPreRender", root, lowerCamera) 
    end 
) 
  
addCommandHandler("togcamera", 
    function(cmd) 
        lower = not lower 
        if lower then 
            removeEventHandler("onClientPreRender", root, lowerCamera) 
            setCameraTarget(localPlayer) 
            outputChatBox("Resetted camera position.", 0, 255, 0, false) 
        else 
            addEventHandler("onClientPreRender", root, lowerCamera) 
            outputChatBox("Lowered camera position.", 0, 255, 0, false) 
        end 
    end 
) 

Edited by Guest
Link to comment

Thanks myonlake, that's a much better way to do it indeed.

But Kiffshark, your image suggests you're trying to decrease the field of view? If so the following is not relevant.

Yesterday I played on a server that featured first person view while driving vehicles. It didn't always work and you couldn't look any other way but forward, but I think it might be a good resource to play around with for your purpose .

http://community.mtasa.com/index.php?p= ... ils&id=844

[Edit: turns out you can look left, right, behind, just not by mouse]

Also, if you haven't already checked it out:

http://community.mtasa.com/index.php?p= ... rst+person

Link to comment

ok, the problem I had was that pedrotation is attached to camera's direction (I like in this way) but if I look too down (to the floor) the ped rotates like if he doesn't know where to go... because of looking vertically to down not give him any horizontal direction... that's why I want something to can't look so down and fix this bug

well, sorry about my english, I think it can be understood :/

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