danielepanozzo/cg

Z coord for viewport transformation

Closed this issue · 7 comments

I am trying to do the viewport transformation, and extend it to 3d. While I have figured out the math part, I am stuck on what logically nz would be. For both nx and ny, it makes sense that we are limited by the proportions of our scene. But for nz, we have no depth limit, so I fail to see how to set it. Could you give me any hints?

Please join the office hour, as it's going to start in a few minutes.

Do we need to viewport transformation?
Isn't it already implemented in the raster.cpp file?

I can't make office hours today or tomorrow; I have classes during that time. Is there some way I could learn on here? Or set up a meeting?

Do we need to viewport transformation? Isn't it already implemented in the raster.cpp file?

I think we need it because in slide deck 11 slide 22, it looks like we implement it in the fragment shader, and all other transformations are made in the vertex shader.

Maybe professor can help us. @danielepanozzo

Do we need to implement the viewport transformation as well?
In the raster.cpp file, in the function rasterize_triangle between line 7 to line 35 isn't this transformation already happening"

@khandu-utkarsh is correct, the pixel coordinates are transformed to the space where the vertices lie in, in raster.cpp from line 7 to line 35, so you don't need to do the transformation inside the FragmentShader().

Thank you!