implement IProjectionSpace
gregsn opened this issue · comments
to get a pixel position posPix into projection space following steps have to be taken:
- identify the viewport the posPix is in
- get from window pixel space to viewport pixels: by just substracting left/top of viewport from posPix
- get from pixels to normalized viewport coords (-1/1 being lefttop 1/-1 rightbottom)
- undo the crop to get into normalized projection space
- undo the aspect ratio to get into projection space
this will help people to interact with their scene no matter how complex the setup
the feature to see here is that the rendered cursor (the quad) is at the right place and is quadratic.
so this is my try of implementing IProjectionSpace:
gregsn@225100c
i had to do several other things to be able to use the newest plugin interface.
todo:
- make Preserve Aspect of WithinProjection true by default and add that change to the diffff.xml
- when rendering resuse the the FViewports instead of recomputing them