Grozz Posted October 4, 2020 Posted October 4, 2020 Any ideas how can I calculate the camera perspective's 4 corners into a flat 2D map? Here's what the camera should see: And here is what should it look like from the outside: I need to calculate the 4 points position
Moderators IIYAMA Posted October 4, 2020 Moderators Posted October 4, 2020 59 minutes ago, Grozz said: I need to calculate the 4 points position I think the following function might be able to do that. https://wiki.multitheftauto.com/wiki/GetWorldFromScreenPosition If you use the function on: 4 corners + with a little depth (START) 4 corners + a lot of depth (END) Per corner check if there is collision between START and END: https://wiki.multitheftauto.com/wiki/ProcessLineOfSight You might be able to get the end result that you want. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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