Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The input format is as follows. This input format is used for all of the parts in this assignment, but each problem interprets the input

The input format is as follows. This input format is used for all of the parts in this assignment, but each problem interprets the input differently.

Num11 Num12 Num13 Num14 Num15 Num16 Num17 Num18 Num19 Num21 Num22 Num23 Num24 Num25 Num26 Num27 Num28 Num29 ... NumK1 NumK2 NumK3 NumK4 NumK5 Num K6 Num K7 NumK8 NumK9

Input file for your submission (one file):

84.00 36.00 55.00 88.00 95.00 31.00 100.00 56.00 87.0019.00 45.00 91.00 2.00 12.00 90.00 31.00 19.00 20.0051.00 63.00 32.00 38.00 21.00 63.00 84.00 62.00 50.009.00 21.00 54.00 55.00 27.00 23.00 37.00 5.00 38.0052.00 77.00 32.00 33.00 27.00 78.00 49.00 6.00 42.0088.00 72.00 100.00 23.00 66.00 10.00 55.00 26.00 99.0018.00 5.00 47.00 67.00 79.00 82.00 12.00 58.00 82.0024.00 93.00 91.00 83.00 70.00 65.00 8.00 79.00 86.0030.00 80.00 98.00 57.00 31.00 34.00 26.00 81.00 48.0041.00 66.00 23.00 42.00 64.00 80.00 53.00 2.00 86.00

Assignment Parts

Part A) This is a simple shading problem based on flat shading. The first line of the input corresponds to the eye location point (Num11, Num12, and Num13) and the light direction (Num14, Num15, and Num16) while ignoring the last three numbers, while the rest of the lines correspond to the three points of the vertices of the triangular planar facets. Use the notation and the orientation in Chapter 8 and Chapter 8.6 where each of three numbers define p, q, r, respectively, in that order. This problem focuses on the intensity of the lighting and there is no coloring, i.e., assume one color base for coloring. As for the lighting model, it is a directional lighting model (where the light comes from a single direction) and the lighting intensity increases as the light is coming from a more perpendicular angle; this is related to the Lambertian model.

First, write a program to perform culling to identify whether the triangle planar facet is front-facing vs. back-facing from your eyes. The output should be a binary value, i.e., 1 if the facet is front-facing and 0 if back-facing. Second, compute the light intensity where it normalized by the maximum intensity when the light arrives at a perpendicular angle (i.e., 1 if perpendicular) and proportional to the cos(x) where x is the angle of incidence if cos(x) is non-negative. The light intensity is non-negative, i.e., if cos(x) is negative, then output 0. Third, write a program building on the previous two which performs culling first and then, if front-facing from the eye's perspective, computes the lighting intensity (culling generally makes the rendering and shading efficient, especially if the shading is more sophisticated than the simple shading used in this problem).

Your output should contain three lines where the first line is for culling, the second line is for the lighting intensity, and the third line is for the combined approach of culling-then-intensity. For each line, there will be K-1 numbers for K-1 triangular planer facets if the input file had K lines (excluding the first line of the input which was not a triangular planar facet). An output file for this Part A includes your solutions for all three sub-parts.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial Accounting

Authors: Jan R. Williams, Susan F. Haka, Mark S. Bettner, Joseph V. Carcello

12th Edition

0071116796, 978-0071116794

More Books

Students also viewed these Accounting questions

Question

How is the NDAA used to shape defense policies indirectly?

Answered: 1 week ago