I want to draw the surface of a top down game using gosu's transform function like this:
However I can't figure out how to construct and use a transformation matrix and how to convert between onscreen positions and on surface positions.
You will probably have to concatenate (multiply) two matrices - one to rotate the image by 90° to make it 'fall on the ground', and another to implement a perspective transform based on Z coordinates. I am sure you can find information about both types of matrices in any book on 3D programming - there are only a handful of common matrix types, anyway. :)
Thanks I should be able to figure that out.
The general problem of conversion between screen coordinate-space positions and surface coordinate-space positions is called 'mouse picking'
Hopefully that helps you out some.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill