3D
Question 1 |
Which of the following statements is/are True regarding the solution to the visibility problem in 3D graphics ?
S1 : The Painter’s algorithm sorts polygons by depth and then paints (scan - converts) each Polygon onto the screen starting with the most nearest polygon. S2 : Backface Culling refers to eliminating geometry with back facing normals. Code :S1 only | |
S2 only
| |
Both S1 and S2 | |
Neither S1 Nor S2 |
Question 1 Explanation:
Visibility problem in 3D graphics
1. Painter's algorithm
- A depth sorting method
- Surfaces are sorted in the order of decreasing depth
- Surfaces are drawn in the sorted order, and overwrite the pixels in the frame buffer - Subtle difference from depth buffer approach: entire face drawn
- Two problems:
• It can be nontrivial to sort the surfaces
• There can be no solution for the sorting order
2. Back Face Culling
- Back faces: faces of opaque object which are “pointing away” from viewer
- Back face culling – remove back faces (supported by OpenGL)
How to detect back faces
- If we find backface, do not draw, save rendering resources
- There must be other forward face(s) closer to eye
- F is face of object we want to test if backface
- P is a point on F
- Form view vector, V as (eye – P)
- N is normal to face F
3. View-Frustum Culling
- Remove objects that are outside the viewing frustum
- Done by 3D clipping algorithm (e.g. Liang-Barsky)
4. Ray Tracing
- Ray tracing is another example of image space method
- Ray tracing: Cast a ray from eye through each pixel to the world
5. Z(Depth buffer algorithm)
Reference: https://web.cs.wpi.edu/~emmanuel/courses/cs543/slides/lecture08_p2.pdf
1. Painter's algorithm
- A depth sorting method
- Surfaces are sorted in the order of decreasing depth
- Surfaces are drawn in the sorted order, and overwrite the pixels in the frame buffer - Subtle difference from depth buffer approach: entire face drawn
- Two problems:
• It can be nontrivial to sort the surfaces
• There can be no solution for the sorting order
2. Back Face Culling
- Back faces: faces of opaque object which are “pointing away” from viewer
- Back face culling – remove back faces (supported by OpenGL)
How to detect back faces
- If we find backface, do not draw, save rendering resources
- There must be other forward face(s) closer to eye
- F is face of object we want to test if backface
- P is a point on F
- Form view vector, V as (eye – P)
- N is normal to face F
3. View-Frustum Culling
- Remove objects that are outside the viewing frustum
- Done by 3D clipping algorithm (e.g. Liang-Barsky)
4. Ray Tracing
- Ray tracing is another example of image space method
- Ray tracing: Cast a ray from eye through each pixel to the world
5. Z(Depth buffer algorithm)
Reference: https://web.cs.wpi.edu/~emmanuel/courses/cs543/slides/lecture08_p2.pdf
Question 2 |
In 3D Graphics, which of the following statements about perspective and parallel projection is/are true?
-
P: In a perspective projection, the farthest an object is from the center of projection, the smaller it appears.
Q: Parallel projection is equivalent to a perspective projection where the viewer is standing infinitely far away
R: Perspective projections do not preserve straight lines.
Choose the correct answer from the code given below:
Code:P and R only | |
P, Q and R | |
Q and R only | |
P and Q only
|
Question 2 Explanation:
Perspective Projection :
Perspective projection is representing or drawing objects which resemble the real thing.
Perspective projection preserves the straight line.
In perspective projection, objects that are far away appear smaller, and objects that are near appear bigger.
Parallel lines do not remain parallel.
Distance and angles are not preserved.
Parallel Projection :
In this projection drawing objects looks less realistic.
In this projection parallel lines remains parallel.
Angles are not preserved in this projection.
It is good for exact measurements.
Perspective projection is representing or drawing objects which resemble the real thing.
Perspective projection preserves the straight line.
In perspective projection, objects that are far away appear smaller, and objects that are near appear bigger.
Parallel lines do not remain parallel.
Distance and angles are not preserved.
Parallel Projection :
In this projection drawing objects looks less realistic.
In this projection parallel lines remains parallel.
Angles are not preserved in this projection.
It is good for exact measurements.
There are 2 questions to complete.
