Hi,
I’m working on a project for demoing a city model.
I’m using a flyover camera thats controlled by the mouse. Scrollwheel is zooming.
However the problem I run in to when calculating the exponential zoom in value is that it works when I’m reaching min height, but it multiplies whenever I reach the max height.
I’ve got a few variables:
- PlayerHeight (float)
- ZoomValue (float)
- MaxHeight (float)
- MinHeight (float)
So what I need is for ZoomValue to be 1 when PlayerHeight is MaxHeight / 2, and ZoomValue to be 0 when at MaxHeight or MinHeight, and everything in between. I guess it’s a simple formula but I can’t figure it out.
MinHeight 0f and MaxHeight is 650f.
Just for reference here’s a table I quickly drew illustrating what I need:
[37562-zoomvalue+table.jpg|37562]
Can anyone help me out? Thanks!