All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Hire a Tutor
AI Study Help
New
Search
Search
Sign In
Register
study help
computer science
computer graphics programming
Questions and Answers of
Computer Graphics Programming
Convert Program 4.2, specifically the modified version with 100,000 cubes, to both anaglyph and side-by-side stereoscopy.Program 4.2Figure 4.8 Vertex Shader: #version 430 layout (location=0) in vec3
Modify Program 17.1 to try a variety of different values for the IOD. What range of values do you think works the best for this scene? What happens if the IOD is set too small? What do you observe as
In Program 4.1, the “view” matrix is defined in the display() function simply as the negative of the camera location:Replace this code with an implementation of the computation shown in Figure
Modify Program 4.4 to include a second “planet,” which is your custom 3D shape from Exercise 4.1. Make sure that your new “planet” is in a different orbit than the existing planet, so that
In Program 9.2, add the ability to move the camera around with the mouse or keyboard. To do this, you will need to utilize the code you developed earlier in Exercise 4.2 for constructing a view
Modify Program 4.1 to replace the cube with some other simple 3D shape of your own design. Be sure to properly specify the number of vertices in the glDrawArrays() command.Program 4.1 Java/JOGL
In Program 8.1, experiment with different settings for glPolygonOffset(), and observe the effects on shadow artifacts such as Peter Panning.Program 8.1 // Much is the same as we have seen before. New
Modify Program 2.5 to include the error-checking modules shown in Program 2.3. After you have that working, try inserting various errors into the shaders and observing both the resulting behavior and
Modify Program 8.1 so that the light can be positioned by moving the mouse, similar to Exercise 7.1. You will probably notice that some lighting positions exhibit shadow artifacts, while others look
Modify Program 2.6 so that it calculates the amount of movement for the triangle based on elapsed time, rather than a constant amount as it is currently implemented. One approach for this is to get
Add animation to Program 8.1, such that either the objects or the light (or both) move around on their own—such as one revolving around the other. The shadow effects will be more pronounced if you
Modify Program 2.5 so that the vertex shader includes one of the buildRotate() functions from Program 3.1 and applies it to the points comprising the triangle. This should cause the triangle to be
Modify Program 5.1 by adding the “noperspective” declaration to the texture coordinate vertex attributes, as described in Section 5.11. Then rerun the program and compare the output with the
Modify Program 2.5 so that it draws an isosceles triangle.Program 2.5 Vertex Shader #version 430 void main(void) { if (gl_VertexID== 0) gl_Position = vec4( 0.25, -0.25, 0.0, 1.0); else if
Modify Program 4.4 so that the “view” matrix is constructed using the “look-at” function. Then experiment with setting the “look-at” parameters to various locations, such as looking at
Learn the basics of how to use Terragen [TE16] to create a simple cube map. This generally entails making a “world” with the desired terrain and atmospheric patterns (in Terragen), and then
At the end of Section 3.4 we indicated that Euler angles can in some cases lead to undesirable artifacts. The most common is called “gimbal lock.” Describe gimbal lock, give an example, and
One way of avoiding the artifacts that can manifest when using Euler angles is to use quaternions. We didn’t study quaternions; however, JOML includes a Quaternionf class. Do some independent study
Propose a practical use for glCullFace(GL_FRONT_AND_BACK).
Replace the positional light in Program 7.2 with a “spot” light, as described in Section 7.2. Experiment with the settings for cutoff angle and falloff exponent, and observe the effects.Program
Modify Program 7.2 so that it incorporates TWO positional lights, placed in different locations. The fragment shader will need to blend the diffuse and specular contributions of each of the lights.
Modify Program 8.2 to replace the hardcoded values 0.001 in the lookup() function, with the more accurate values of 1.0/shadowbufferwidth and 1.0/shadowbufferheight. Observe to what degree this
Modify Program 9.3 so that the object in the scene blends environment mapping with a texture. Use a weighted sum in the fragment shader, as described in Chapter 7.Program 9.3 public
More sophisticated implementations of percentage closer filtering (PCF) take into account the relative distance between the light and the shadow versus the light and the occluder. Doing this can make
Draw labels on the six cube map image files to confirm that the correct oriention is being achieved. For example, you could draw axis labels on the images, such as the following:Also use your
Experiment with Program 10.1 by modifying the settings and/or computations in the fragment shader and observing the results.Program 10.1 Vertex Shader #version 430 // same as Phong shading, but add
Using a paint program, generate your own height map and use it in Program 10.4. See if you can identify locations where detail is missing as the result of the vertex shader being unable to adequately
Add lighting to Program 10.4, so that the surface structure of the height-mapped terrain is further exposed.Program 10.4 #version 430 layout (location=0) in vec3 vertPos; layout (location=1) in vec2
Add shadow mapping to your code from Exercise 10.3 so that your height-mapped terrain casts shadows.Exercise 10.3 // variables and structs as in previous fragment shader, plus: // normal map //
A quadratic Bézier curve is limited to defining a curve that is wholly “concave” or “convex.” Describe (or draw) an example of a curve that bends in a manner that is neither wholly concave
Using a pen or pencil, draw an arbitrary set of four points on a piece of paper, number them from 1 to 4 in any order, and then try to draw an approximation of the cubic Bézier curve defined by
Modify Program 2.2 to add animation that causes the drawn point to grow and shrink, in a cycle. Hint: use the glPointSize() function, with a variable as the parameter.Program 2.2 (.....imports as
Convert Program 12.5, the tessellated moon surface, to both anaglyph and side-by-side stereoscopic rendering. Animate the camera movement so that it skims along and close to the moon surface.Program
Modify Program 16.13 to build a scene with a transparent sphere and a transparent box, both of different colors. Include the vertical checkerboard plane behind them as a backdrop. Experiment with the
In Figure 16.28 (the center image), the Sugita/Takehashi blending of red and green produces black. Is this a reasonable result? If not, can you devise a workaround that doesn’t compromise other
Repeat Exercise 7.1, but applied to Program 7.2. This should only require substituting the shaders for Phong shading into your solution to Exercise 7.1. The improvement from Gouraud to Phong shading
Modify Program 7.1 so that the light can be positioned by moving the mouse. After doing this, move the mouse around and note the movement of the specular highlight and the appearance of the Gouraud
Learn the basics of how to use Blender to create a 3D object of your own. To make full use of Blender with your OpenGL applications, you’ll want to learn how to use Blender’s UV-unwrapping tools
Modify your program from Exercise 6.1 so that the imported NASA shuttle object from Figure 6.16 also orbits the “sun.” You’ll want to experiment with the scale and rotation applied to the
Modify Program 4.4 so that the “sun,” “planet,” and “moon” are textured spheres, such as the ones shown in Figure 4.11.Program 4.4Figure 4.11 private Matrix4fStack mvStack = new
Using a simple “paint” program (such as Windows “Paint” or GIMP [GI16]), draw a freehand picture of your own design. Then use your image to texture the pyramid in Program 5.1.Program 5.1
Modify Program 4.4 so that the “sun,” “planet,” and “moon” are textured. You may continue to use the shapes already present, and you may use any texture you like. This will require you to
Modify Program 12.1 to experiment with various values for inner and outer tessellation levels and observing the resulting rendered mesh.Program 12.1 Java/JOGL application public int createShader
Test Program 12.5 with the layout specifier in the evaluation shader set to equal_spacing, and then to fractional_even_spacing, as described in Section 12.4. Observe the effects on the rendered
Modify Program 12.4 to utilize a height map of your own design. Then add lighting and shadow mapping so that your tessellated terrain casts shadows. This is a complex exercise, because some of the
Modify Program 14.4 (the version including the modification in Figure 14.10 that produces a 3D cubed texture) so that it instead textures the Studio 522 dolphin. Then observe the results. Many people
Modify Program 13.1 so that it moves each vertex slightly toward the center of its primitive triangle. The result should look similar to the exploded torus in Figure 13.5, but without the overall
Modify Program 13.4 to additionally render the original torus. That is, render both a lighted torus and the outgoing line segments (using a geometry shader) so that the “hair” looks like it is
Modify Program 14.2 to gradually decrease the alpha value of an object, causing it to progressively fade out and eventually disappear.Program 14.2 JOGL/Java application - in display() for rendering
Modify Program 13.2 so that it deletes every other primitive, or every fourth primitive (rather than every third primitive), and observe the effect on the resulting rendered torus. Also, try changing
Modify Program 13.4 so that it produces outward-facing line segments with more than two vertices, arranged so as to make the line segments appear to bend slightly.Program 13.4 layout (line_strip,
Modify Program 14.3 to clip the torus along the horizontal, creating a circular “trough.”Program 14.3 Java/JOGL application: public void display(GLAutoDrawable drawable) { ... flipLoc
Incorporate the logistic function (from Program 14.7) into the marble dragon from Program 14.5, and experiment with the settings to create more distinct veins.Program 14.5 Java/JOGL
The simple sine wave used to define the wood “rings” generate rings in which the light and dark areas are equal width. Experiment with modifications to the associated fillDataArray() function
Modify Program 14.9 to incorporate the zooming, smoothing, turbulence, and logistic steps described in prior sections. Observe the changes in the resulting dissolve effect.Program 14.9 Java/JOGL
Add a flying object such as a bird or airplane (or even the NASA space shuttle model) flying overhead, above the top surface of the water. Then include it in the reflection off the top surface of the
Add an object moving underwater, such as a fish or submarine (or even the Studio 522 dolphin) below the top surface of the water. Then include it in the scene when the camera is below the top surface
In Exercise 15.2 (above), if you haven’t done so already, add water caustics to the underwater object.Exercise 15.2Add an object moving underwater, such as a fish or submarine (or even the Studio
Modify the fragment shader in Program 15.8 so that the water caustics are also rendered when the camera is above the top surface as well. Do you think that the scene appears more realistic or less
In Program 16.4, shadows can be very easily disabled by commenting out one particular line of code. Identify that line of code.Program 16.4 Compute Shader vec3 ads_phong_lighting (Ray r, Collision
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
Make the following changes to Program 16.10:(i) Move the box so that it is in front of the sphere,(ii) Make the box transparent/refractive, and the sphere reflective,(iii) Move the checkerboard plane
In Program 16.12, replace the blue roombox with the lake scene skybox. Don’t forget to disable lighting on the skybox.Program 16.12 Compute Shader struct Stack Element { int type; int depth; //