rain_gloom Posted September 3, 2014 Share Posted September 3, 2014 Could someone help with the math here? If I have a line of length 'a' and it is 'd' distance away from the camera, how do I calculate the perspectively correct size on screen? I checked existing 3d text resources, but the only method I found is incorrect and I don't know what to google. ._. (Part of what I'm trying to do is to replicate the "effect" system of the game "XIII", that's why I want it to be this way) Link to comment
Skuleris Posted September 3, 2014 Share Posted September 3, 2014 Have you tried dividing lenght by distance? Link to comment
xXMADEXx Posted September 3, 2014 Share Posted September 3, 2014 local fontSize = 2 -- the original text size local dist = getDistanceBetweenPoints3D ( x, y, z, x1, y1, z1 ); -- Set the distance with getDistanceBetweenPoints3D\ local allowedDistance = 13; -- The max distance you can be to see the text local scale = fontSize * ( ( defdd - dist ) / defdd ) (Formula taken from the following resource) https://community.multitheftauto.com/index.php?p= ... ls&id=3090 Link to comment
rain_gloom Posted September 3, 2014 Author Share Posted September 3, 2014 That's one I found too, I tried it. Although not as good as it should be, I think I'll settle for that. For now. 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