Modify Program 14.4 (the version including the modification in Figure 14.10 that produces a 3D cubed texture)

Question:

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 when first observing the result—such as that shown on the dragon, but also even on simpler objects—believe that there is some error in the program. Unexpected surface patterns can result from “carving” an object out of 3D textures, even in simple cases.

Program 14.4Java/JOGL application: private int texWidth = 256; private int texHeight= 256; private int texDepth = 256;// fill a byte array with RGB blue/yellow values corresponding to the pattern built by generate3Dpattern()// build 3D pattern of stripes void generate3Dpattern() { for (int x=0; xgl.glBind Texture(GL_TEXTURE_3D, texturelD); gl.gl TexStorage3D(GL_TEXTURE_3D, gl.gltexWidth, texHeight, texDepth, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, bb); gl.gl TexParameteri(GL_TEXTURE_3D,layout (binding=0) uniform sampler3D s; void main(void) { original Position = position; //pass original model

Figure 14.10void generate3Dpattern() { int xStep, yStep, zStep, sumSteps; for (int x=0; x

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: