My recollection is that terrain picking doesn’t work properly for rotated terrain. It neglects to properly transform the ray into local space or something.
You will probably have an easier time leaving terrain in the x/z plane and just doing your zoom based on y instead of z.
Your code may be strange if this isn’t just a matter of changing z for y. If it’s just a mental block then you may need to ‘get over it’. And I sympathize because I also had to ‘get over it’ after a decade in the vis-sim industry thinking of z as up and x/y as ‘map’. (100+ forgetting swap y for z bugs later and I just made an effort to adapt.)
Hi. Thank you for your replies. It’s not just for zoom but for some other calculations that transform spherical coordinates to x-y-z coordinates. I rewrote the calculations to have y up and now everything works.