mrvux / dx11-vvvv

DirectX11 Rendering within vvvv

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

implement IProjectionSpace

gregsn opened this issue · comments

https://github.com/vvvv/vvvv/commit/3875b7079204d106cc0a822a2ff3bb32562620fb#diff-dc9dac49f758a8824170070e3b0ef204

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.
callmenames_2018 01 14-02 29 33
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