Closed ksmolenskiy closed 6 years ago
For what it's worth, that "zoom" control is provided via the "screenwindow" parameter, which gives a 2D extent on the projection plane. (In turn, that is passed to the ProjectiveCamera constructor, which uses it to set the ScreenToRaster transformation.) So I believe that it's all consistent / has the expected flexibility in that respect.
Good point about the depth range in those spaces; this is definitely one of those places where rasterizers need near and far clipping planes for everything to work, but for a ray tracer, we don't need to worry about it. I've made a note to improve the discussion of this topic in the 4th edition.
Thanks!
Hello.
Orthographic transform now is
Transform Orthographic(Float zNear, Float zFar) {
return Scale(1, 1, 1 / (zFar - zNear)) * Translate(Vector3f(0, 0, -zNear));
}
With only call inOrthographicCamera
constructor:Orthographic(0, 1)
Which makes it identity matrix. As a consequence: 1) there is no control of "zoom". It always captures scene with extents of width 2 and height 2 in camera space, with aspect modification. Usually ortho matrix has 2/width and 2/height in (0,0) and (1,1) entries for that kind of control. 2) book states that screen space, NDC and raster space have depth from 0 to 1, but with a call with1
forzFar
this isn't fulfilled.