Post by tobiasmarciszko on Nov 19, 2019 16:13:13 GMT
I'm investigating Qt3D to add a realtime "preview" layer before rendering the scene at hand. I already have a "wireframe" mode that shows the bounding boxes of the objects. For the wireframe mode I am projecting the world coordinates to the 2D plane like so:
I am now looking at adding another preview layer using OpenGL or (as of now) Qt3D since I am using a QML UI. However, what I am missing is the description of the projection we're using. I understand we have a view transform in the Camera we've implemented but I don't really see that mapping between the Camera and a projection matrix that is mentioned elsewhere.
But what is the projection matrix that we end up using? I'm struggling to get a perfect match between the rendered image and the OpenGL view I am trying to use
Post by tobiasmarciszko on Nov 20, 2019 12:00:57 GMT
I managed to define a OpenGL projection matrix that I'm using for the projection. The only thing I still don't get is that it doesn't match. I ended up "tweaking" the scale factor with a magic number to make it look decent...
Cool! Sadly, I don't know the answer to the projection matrix question. I wrestled with that briefly at one point, too, but didn't spend enough time on it to figure it out. The ray tracer's projection matrix is implicit in the way screen is configured for the rays to be shot through.