Make the following simple changes to Program 16.5: (i) Move the box so that it is behind

Question:

Make the following simple changes to Program 16.5:

(i) Move the box so that it is behind the sphere, but still visible,

(ii) Change the background color from black to light blue, 

(iii) Modify the properties and position of the light source.

Program 16.5Compute Shader vec3 box_mins=vec3(-0.5, -0.5, -1.0); vec3 box_maxs = vec3(0.5, 0.5, 1.0); vec3 box_pos=Collision intersect_box_object(Ray r) { // Compute the box's local-space to world-space transform matrices// Convert the world-space ray to the box's local space: vec3 ray_start = (world_to_localTR * vec4(r.start,} // Calculate the world-position of the intersection: c.p = r.start + c.t * r.dir; return c;

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Computer Graphics Programming In OpenGL With JAVA

ISBN: 9781683922193

2nd Edition

Authors: V. Scott Gordon PhD, John L. Clevenger PhD

Question Posted: