Question: 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

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.1JAVA/JOGL Application // the following additional imports will be necessary for the texture functions: importpublic Code() { // unchanged... } public void display(GLAutoDrawable drawable) { GL4 gl= (GL4)} // activate buffer #1, which contains the texture coordinates gl.glBindBuffer(GL_ARRAY_BUFFER, vbo[1]);private void setupVertices() { GL4 gl = (GL4) GLContext.getCurrentGL(); float[] pyramidPositions = { /* dataVertex shader #version 430 layout (location=0) in vec3 pos; layout (location=1) in vec2 texCoord; out vec2uniform mat4 mv_matrix; uniform mat4 p_matrix; layout (binding=0) uniform sampler2D samp; // not used inFragment shader #version 430 in vec2 tc; out vec4 color; // interpolated incoming texture coordinate uniform

JAVA/JOGL Application // the following additional imports will be necessary for the texture functions: import java.io.*; import java.nio.*; import com.jogamp.opengl.util.texture.*; public class Code extends JFrame implements GLEventListener { // previous declarations and constructor code applies. We just need to add declarations for the texture: private int brick Texture; public Code() { // unchanged... } public void display(GLAuto Drawable drawable) { GL4 gl = (GL4) GLContext.getCurrentGL();

Step by Step Solution

3.42 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Graphics Programming Questions!