Question

Computer Graphics/Web-GL questions Question 26 Consider three vectors, l, n, and v, which are direction of...

Computer Graphics/Web-GL questions

Question 26

Consider three vectors, l, n, and v, which are direction of in ray, normal of the surface, and out ray, respectively. If the viewer is distant (i.e. at infinite), which of the following is constant?

l

n

v

none of these three

Question 27

Since the sphere is not an object supported within WebGL, so we will generate approximations to a sphere using_________ through a process known as recursive subdivision.

Which of the following is the best fit into the blank above?

traingle

rectangle

disk

square

Question 28

When we try to apply lighting model in application, we use some math functions in MV.sj file. What is the value of d if

var d = dot(normal, lightPosition);

where lightPosition = vec3(10, 4, 12); and normal =  vec3(0.0, 0.0, 1.0); ?

(0.0, 0.0, 12.0)

(10.0, 4.0, 13.0)

27.0

12.0

Question 29

To implement lighting in the vertex shader, we must carry out three steps. Please order them

      -       1.       2.       3.      

write an apporpriate vertex shader


      -       1.       2.       3.      

transfer the necessary data to appropriate place


      -       1.       2.       3.      

Question 30

Suppose that we use only two colors in a vertex shader:

vec4 color1 = vec4(1.0, 1.0, 0.0, 1.0); // yellow 
vec4 color2 = vec4(1.0, 0.0, 0.0, 1.0); // red

We could then switch between the colors based, for example, on the magnitude ofthe diffuse color. Using the light and normal vectors, we could assign colors as

gl_FragColor = (dot(lightv, norm)) > 0.5 ? color1 : color2);

Which of the following will assign yellow to gl_FragColor?

lighty = (0, 0, 1) and norm = (0, 1, 0)

lighty = (1, 0, 0) and norm = (0, 1, 0)

lighty = (0, 1, 0) and norm = (0, 1, 0);

non of these

Homework Answers

Answer #1

Q26)

Answer is Option C

The Out Ray i.e. v is constant

Q27)

Answer is Option A

Since the sphere is not an object supported within WebGL, so we will generate approximations to a sphere using___Triangle  through a process known as recursive subdivision.

Q28)

Answer is Option D

Dot Product d = 10 * 0.0 + 4*0.0 + 12 * 1.0 = 12 .0

Q29)

Correct Order is

Choose a lighting model.

write an appropriate vertex shader

transfer the necessary data to appropriate place

Q30)

Answer is Option C

lighty = (0, 1, 0) and norm = (0, 1, 0) will be assign yellow to gl_FragColor because dot product of other options <0.5 so red will be assigned in those .

These are the answer of given Problems

Thank You

If u like the answer then do Upvote it and have any doubt ask in comments

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT