I'm trying to reproduce the 'landscaping' technique of the old 8-bit game Lords of Midnight, it draws the world view in 2d/pseudo 3d and I'm attempting to do the same with billboards of 2d sprites in a 3d world. There's a modern recreation of the game here which shows what it should look like when the player changes the direction they're looking (ignore the slide transition): https://youtu.be/fzO77o_fCfQ?t=552
The problem is I've been racking my brain but I can't work out the right maths to draw the map locations at the correct positions on the screen to give the correct perspective.
I'll give an example of what I'm after with two positions, North and Northeast. Positions (x,y,z): Camera 0,0,0 - North 0,0,1 - Northeast 1,0,1
Here's what the view should look like when looking north (0 degrees):
Northeast is further away so has as z value of ~1.414.
Here's the view when looking northeast (45 degrees):
Northeast's z value is now 1, North's z value I would expect to be 1.414 but the sprite has to be offset slightly on x and z to get it in the right position. It looks like x's new value is x + (1.414 -1) / 2, and z is z - (1.414 -1) / 2 which appears to have a close relationship with the cosine of the angle but I can't work out how to fit it in a calculation.
I can kinda work out how to adjust the z values using the difference between the camera angle and the position's angle to the camera but I'm lost on the offset part, any help would be most gratefully received.
