Draw an image of a house with a chimney using WebGL in a single HTML file. Make the canvas take the full page.
Draw an image of a house with a chimney using WebGL in a single HTML file. Make the canvas take the full page.
# WebGL House with Chimney Here's a complete HTML file that draws a house with a chimney using WebGL, with the canvas taking the full page:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>WebGL House with Chimney</title> <style> body { margin: 0; overflow: hidden; } canvas { display: block; width: 100vw; height: 100vh; } </style> </head> <body> <canvas id="glCanvas"></canvas> <script> // Initialize WebGL const canvas = document.getElementById('glCanvas'); const gl = canvas.getContext('webgl'); if (!gl) { alert('WebGL not supported in your browser!'); throw new Error('WebGL not supported'); } // Resize canvas to match window size function resizeCanvas() { canvas.width = window.innerWidth; canvas.height = window.innerHeight; gl.viewport(0, 0, canvas.width, canvas.height); } window.addEventListener('resize', resizeCanvas); resizeCanvas(); // Vertex shader program const vsSource = ` attribute vec4 aPosition; attribute vec4 aColor; varying vec4 vColor; void main() { gl_Position = aPosition; vColor = aColor; } `; // Fragment shader program const fsSource = ` precision mediump float; varying vec4 vColor; void main() { gl_FragColor = vColor; } `; // Create shader program function createShader(gl, type, source) { const shader = gl.createShader(type); gl.shaderSource(shader, source); gl.compileShader(shader); if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { console.error('Shader compilation error:', gl.getShaderInfoLog(shader)); gl.deleteShader(shader); return null; } return shader; } function createProgram(gl, vertexShader, fragmentShader) { const program = gl.createProgram(); gl.attachShader(program, vertexShader); gl.attachShader(program, fragmentShader); gl.linkProgram(program); if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { console.error('Program linking error:', gl.getProgramInfoLog(program)); return null; } return program; } const vertexShader = createShader(gl, gl.VERTEX_SHADER, vsSource); const fragmentShader = createShader(gl, gl.FRAGMENT_SHADER, fsSource); const program = createProgram(gl, vertexShader, fragmentShader); // Define house geometry // Using normalized device coordinates (-1 to 1 for both x and y) const vertices = [ // House main body (square) - brown -0.5, -0.5, 0.6, 0.4, 0.2, 1.0, // bottom left 0.5, -0.5, 0.6, 0.4, 0.2, 1.0, // bottom right 0.5, 0.3, 0.6, 0.4, 0.2, 1.0, // top right -0.5, -0.5, 0.6, 0.4, 0.2, 1.0, // bottom left 0.5, 0.3, 0.6, 0.4, 0.2, 1.0, // top right -0.5, 0.3, 0.6, 0.4, 0.2, 1.0, // top left // Roof (triangle) - red -0.6, 0.3, 0.8, 0.2, 0.2, 1.0, // bottom left 0.6, 0.3, 0.8, 0.2, 0.2, 1.0, // bottom right 0.0, 0.7, 0.8, 0.2, 0.2, 1.0, // top // Chimney (rectangle) - dark gray 0.3, 0.3, 0.3, 0.3, 0.3, 1.0, // bottom left 0.5, 0.3, 0.3, 0.3, 0.3, 1.0, // bottom right 0.5, 0.6, 0.3, 0.3, 0.3, 1.0, // top right 0.3, 0.3, 0.3, 0.3, 0.3, 1.0, // bottom left 0.5, 0.6, 0.3, 0.3, 0.3, 1.0, // top right 0.3, 0.6, 0.3, 0.3, 0.3, 1.0, // top left // Door (rectangle) - dark brown -0.1, -0.5, 0.4, 0.2, 0.1, 1.0, // bottom left 0.1, -0.5, 0.4, 0.2, 0.1, 1.0, // bottom right 0.1, -0.1, 0.4, 0.2, 0.1, 1.0, // top right -0.1, -0.5, 0.4, 0.2, 0.1, 1.0, // bottom left 0.1, -0.1, 0.4, 0.2, 0.1, 1.0, // top right -0.1, -0.1, 0.4, 0.2, 0.1, 1.0, // top left // Window 1 (rectangle) - light blue -0.4, -0.1, 0.6, 0.8, 1.0, 1.0, // bottom left -0.2, -0.1, 0.6, 0.8, 1.0, 1.0, // bottom right -0.2, 0.1, 0.6, 0.8, 1.0, 1.0, // top right -0.4, -0.1, 0.6, 0.8, 1.0, 1.0, // bottom left -0.2, 0.1, 0.6, 0.8, 1.0, 1.0, // top right -0.4, 0.1, 0.6, 0.8, 1.0, 1.0, // top left // Window 2 (rectangle) - light blue 0.2, -0.1, 0.6, 0.8, 1.0, 1.0, // bottom left 0.4, -0.1, 0.6, 0.8, 1.0, 1.0, // bottom right 0.4, 0.1, 0.6, 0.8, 1.0, 1.0, // top right 0.2, -0.1, 0.6, 0.8, 1.0, 1.0, // bottom left 0.4, 0.1, 0.6, 0.8, 1.0, 1.0, // top right 0.2, 0.1, 0.6, 0.8, 1.0, 1.0 // top left ]; // Create buffer and load vertex data const vertexBuffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW); // Get attribute locations const positionAttributeLocation = gl.getAttribLocation(program, 'aPosition'); const colorAttributeLocation = gl.getAttribLocation(program, 'aColor'); // Set up attribute pointers gl.vertexAttribPointer( positionAttributeLocation, 2, // 2 components per vertex (x, y) gl.FLOAT, // data type false, // don't normalize 6 * Float32Array.BYTES_PER_ELEMENT, // stride (6 values per vertex) 0 // offset ); gl.enableVertexAttribArray(positionAttributeLocation); gl.vertexAttribPointer( colorAttributeLocation, 4, // 4 components per color (r, g, b, a) gl.FLOAT, // data type false, // don't normalize 6 * Float32Array.BYTES_PER_ELEMENT, // stride (6 values per vertex) 2 * Float32Array.BYTES_PER_ELEMENT // offset (skip 2 position values) ); gl.enableVertexAttribArray(colorAttributeLocation); // Draw the scene function drawScene() { // Clear the canvas gl.clearColor(0.8, 0.9, 1.0, 1.0); // Light blue sky background gl.clear(gl.COLOR_BUFFER_BIT); // Use the shader program gl.useProgram(program); // Draw the house gl.drawArrays(gl.TRIANGLES, 0, vertices.length / 6); // Request animation frame for continuous rendering requestAnimationFrame(drawScene); } // Start the rendering loop drawScene(); </script> </body> </html> |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>WebGL House with Chimney</title> <style> body { margin: 0; overflow: hidden; } canvas { display: block; width: 100vw; height: 100vh; } </style> </head> <body> <canvas id="glCanvas"></canvas> <script> // Initialize WebGL const canvas = document.getElementById('glCanvas'); const gl = canvas.getContext('webgl'); if (!gl) { alert('WebGL not supported in your browser!'); throw new Error('WebGL not supported'); } // Resize canvas to match window size function resizeCanvas() { canvas.width = window.innerWidth; canvas.height = window.innerHeight; gl.viewport(0, 0, canvas.width, canvas.height); } window.addEventListener('resize', resizeCanvas); resizeCanvas(); // Vertex shader program const vsSource = ` attribute vec4 aPosition; attribute vec4 aColor; varying vec4 vColor; void main() { gl_Position = aPosition; vColor = aColor; } `; // Fragment shader program const fsSource = ` precision mediump float; varying vec4 vColor; void main() { gl_FragColor = vColor; } `; // Create shader program function createShader(gl, type, source) { const shader = gl.createShader(type); gl.shaderSource(shader, source); gl.compileShader(shader); if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { console.error('Shader compilation error:', gl.getShaderInfoLog(shader)); gl.deleteShader(shader); return null; } return shader; } function createProgram(gl, vertexShader, fragmentShader) { const program = gl.createProgram(); gl.attachShader(program, vertexShader); gl.attachShader(program, fragmentShader); gl.linkProgram(program); if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { console.error('Program linking error:', gl.getProgramInfoLog(program)); return null; } return program; } const vertexShader = createShader(gl, gl.VERTEX_SHADER, vsSource); const fragmentShader = createShader(gl, gl.FRAGMENT_SHADER, fsSource); const program = createProgram(gl, vertexShader, fragmentShader); // Define house geometry // Using normalized device coordinates (-1 to 1 for both x and y) const vertices = [ // House main body (square) - brown -0.5, -0.5, 0.6, 0.4, 0.2, 1.0, // bottom left 0.5, -0.5, 0.6, 0.4, 0.2, 1.0, // bottom right 0.5, 0.3, 0.6, 0.4, 0.2, 1.0, // top right -0.5, -0.5, 0.6, 0.4, 0.2, 1.0, // bottom left 0.5, 0.3, 0.6, 0.4, 0.2, 1.0, // top right -0.5, 0.3, 0.6, 0.4, 0.2, 1.0, // top left // Roof (triangle) - red -0.6, 0.3, 0.8, 0.2, 0.2, 1.0, // bottom left 0.6, 0.3, 0.8, 0.2, 0.2, 1.0, // bottom right 0.0, 0.7, 0.8, 0.2, 0.2, 1.0, // top // Chimney (rectangle) - dark gray 0.3, 0.3, 0.3, 0.3, 0.3, 1.0, // bottom left 0.5, 0.3, 0.3, 0.3, 0.3, 1.0, // bottom right 0.5, 0.6, 0.3, 0.3, 0.3, 1.0, // top right 0.3, 0.3, 0.3, 0.3, 0.3, 1.0, // bottom left 0.5, 0.6, 0.3, 0.3, 0.3, 1.0, // top right 0.3, 0.6, 0.3, 0.3, 0.3, 1.0, // top left // Door (rectangle) - dark brown -0.1, -0.5, 0.4, 0.2, 0.1, 1.0, // bottom left 0.1, -0.5, 0.4, 0.2, 0.1, 1.0, // bottom right 0.1, -0.1, 0.4, 0.2, 0.1, 1.0, // top right -0.1, -0.5, 0.4, 0.2, 0.1, 1.0, // bottom left 0.1, -0.1, 0.4, 0.2, 0.1, 1.0, // top right -0.1, -0.1, 0.4, 0.2, 0.1, 1.0, // top left // Window 1 (rectangle) - light blue -0.4, -0.1, 0.6, 0.8, 1.0, 1.0, // bottom left -0.2, -0.1, 0.6, 0.8, 1.0, 1.0, // bottom right -0.2, 0.1, 0.6, 0.8, 1.0, 1.0, // top right -0.4, -0.1, 0.6, 0.8, 1.0, 1.0, // bottom left -0.2, 0.1, 0.6, 0.8, 1.0, 1.0, // top right -0.4, 0.1, 0.6, 0.8, 1.0, 1.0, // top left // Window 2 (rectangle) - light blue 0.2, -0.1, 0.6, 0.8, 1.0, 1.0, // bottom left 0.4, -0.1, 0.6, 0.8, 1.0, 1.0, // bottom right 0.4, 0.1, 0.6, 0.8, 1.0, 1.0, // top right 0.2, -0.1, 0.6, 0.8, 1.0, 1.0, // bottom left 0.4, 0.1, 0.6, 0.8, 1.0, 1.0, // top right 0.2, 0.1, 0.6, 0.8, 1.0, 1.0 // top left ]; // Create buffer and load vertex data const vertexBuffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW); // Get attribute locations const positionAttributeLocation = gl.getAttribLocation(program, 'aPosition'); const colorAttributeLocation = gl.getAttribLocation(program, 'aColor'); // Set up attribute pointers gl.vertexAttribPointer( positionAttributeLocation, 2, // 2 components per vertex (x, y) gl.FLOAT, // data type false, // don't normalize 6 * Float32Array.BYTES_PER_ELEMENT, // stride (6 values per vertex) 0 // offset ); gl.enableVertexAttribArray(positionAttributeLocation); gl.vertexAttribPointer( colorAttributeLocation, 4, // 4 components per color (r, g, b, a) gl.FLOAT, // data type false, // don't normalize 6 * Float32Array.BYTES_PER_ELEMENT, // stride (6 values per vertex) 2 * Float32Array.BYTES_PER_ELEMENT // offset (skip 2 position values) ); gl.enableVertexAttribArray(colorAttributeLocation); // Draw the scene function drawScene() { // Clear the canvas gl.clearColor(0.8, 0.9, 1.0, 1.0); // Light blue sky background gl.clear(gl.COLOR_BUFFER_BIT); // Use the shader program gl.useProgram(program); // Draw the house gl.drawArrays(gl.TRIANGLES, 0, vertices.length / 6); // Request animation frame for continuous rendering requestAnimationFrame(drawScene); } // Start the rendering loop drawScene(); </script> </body> </html> |
Rendering the webpage gives the following image:
This is a screenshot of a webpage that draws something with webgl. I'm trying to see if it drew what I wanted. Describe what is drawn in this image?
The image depicts a simple, stylized house. It has a brown square base with two light blue square windows and a dark brown rectangular door. The roof is a red triangle, and there is a gray rectangular chimney on the right side of the roof. The background is a light blue color.
Does this answer say that there is a picture of a house with a chimney "The image depicts a simple, stylized house. It has a brown square base with two light blue square windows and a dark brown rectangular door. The roof is a red triangle, and there is a gray rectangular chimney on the right side of the roof. The background is a light blue color."? Answer "Yes it does" or "No it does not".
Yes it does.
Testing if the previous output contains the string es it does
: True
Testing if the previous output contains the string THREE.
: False
Draw an image of a house with a chimney using WebGL in a single HTML file. Make the canvas take the full page.
Draw an image of a house with a chimney using WebGL in a single HTML file. Make the canvas take the full page.
# WebGL House with Chimney Here's a complete HTML file that draws a house with a chimney using WebGL. The canvas will take up the full page:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>WebGL House with Chimney</title> <style> body, html { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; } canvas { display: block; width: 100%; height: 100%; } </style> </head> <body> <canvas id="glCanvas"></canvas> <script> window.onload = function() { const canvas = document.getElementById('glCanvas'); // Make canvas match window size canvas.width = window.innerWidth; canvas.height = window.innerHeight; // Initialize WebGL context const gl = canvas.getContext('webgl'); if (!gl) { alert('WebGL not supported in your browser!'); return; } // Vertex shader program const vsSource = ` attribute vec4 aVertexPosition; attribute vec4 aVertexColor; uniform mat4 uModelViewMatrix; uniform mat4 uProjectionMatrix; varying lowp vec4 vColor; void main() { gl_Position = uProjectionMatrix * uModelViewMatrix * aVertexPosition; vColor = aVertexColor; } `; // Fragment shader program const fsSource = ` precision mediump float; varying lowp vec4 vColor; void main() { gl_FragColor = vColor; } `; // Create shader program const shaderProgram = initShaderProgram(gl, vsSource, fsSource); // Collect shader program info const programInfo = { program: shaderProgram, attribLocations: { vertexPosition: gl.getAttribLocation(shaderProgram, 'aVertexPosition'), vertexColor: gl.getAttribLocation(shaderProgram, 'aVertexColor'), }, uniformLocations: { projectionMatrix: gl.getUniformLocation(shaderProgram, 'uProjectionMatrix'), modelViewMatrix: gl.getUniformLocation(shaderProgram, 'uModelViewMatrix'), }, }; // Initialize buffers with house geometry const buffers = initBuffers(gl); // Draw the scene drawScene(gl, programInfo, buffers); // Handle window resize window.addEventListener('resize', function() { canvas.width = window.innerWidth; canvas.height = window.innerHeight; gl.viewport(0, 0, canvas.width, canvas.height); drawScene(gl, programInfo, buffers); }); }; // Initialize shader program function initShaderProgram(gl, vsSource, fsSource) { const vertexShader = loadShader(gl, gl.VERTEX_SHADER, vsSource); const fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fsSource); // Create the shader program const shaderProgram = gl.createProgram(); gl.attachShader(shaderProgram, vertexShader); gl.attachShader(shaderProgram, fragmentShader); gl.linkProgram(shaderProgram); // Check if creation succeeded if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { console.error('Unable to initialize the shader program: ' + gl.getProgramInfoLog(shaderProgram)); return null; } return shaderProgram; } // Create a shader of given type function loadShader(gl, type, source) { const shader = gl.createShader(type); gl.shaderSource(shader, source); gl.compileShader(shader); // Check if compilation succeeded if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { console.error('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader)); gl.deleteShader(shader); return null; } return shader; } // Initialize buffers for the house function initBuffers(gl) { // Create position buffer const positionBuffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer); // Define house geometry vertices const positions = [ // Main house (wall) -0.5, -0.3, 0.0, // Bottom left 0.5, -0.3, 0.0, // Bottom right 0.5, 0.3, 0.0, // Top right -0.5, 0.3, 0.0, // Top left // Roof (triangle) -0.6, 0.3, 0.0, // Left 0.6, 0.3, 0.0, // Right 0.0, 0.7, 0.0, // Top // Chimney 0.3, 0.3, 0.0, // Bottom left 0.45, 0.3, 0.0, // Bottom right 0.45, 0.6, 0.0, // Top right 0.3, 0.6, 0.0, // Top left // Door -0.15, -0.3, 0.0, // Bottom left 0.15, -0.3, 0.0, // Bottom right 0.15, 0.05, 0.0, // Top right -0.15, 0.05, 0.0, // Top left // Left window -0.35, 0.0, 0.0, -0.15, 0.0, 0.0, -0.15, 0.2, 0.0, -0.35, 0.2, 0.0, // Right window 0.15, 0.0, 0.0, 0.35, 0.0, 0.0, 0.35, 0.2, 0.0, 0.15, 0.2, 0.0, ]; gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW); // Color buffer const colorBuffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer); const colors = [ // House wall - beige 0.95, 0.87, 0.73, 1.0, 0.95, 0.87, 0.73, 1.0, 0.95, 0.87, 0.73, 1.0, 0.95, 0.87, 0.73, 1.0, // Roof - reddish 0.8, 0.3, 0.3, 1.0, 0.8, 0.3, 0.3, 1.0, 0.8, 0.3, 0.3, 1.0, // Chimney - brick red 0.6, 0.2, 0.2, 1.0, 0.6, 0.2, 0.2, 1.0, 0.6, 0.2, 0.2, 1.0, 0.6, 0.2, 0.2, 1.0, // Door - brown 0.55, 0.27, 0.07, 1.0, 0.55, 0.27, 0.07, 1.0, 0.55, 0.27, 0.07, 1.0, 0.55, 0.27, 0.07, 1.0, // Left window - light blue 0.7, 0.9, 1.0, 1.0, 0.7, 0.9, 1.0, 1.0, 0.7, 0.9, 1.0, 1.0, 0.7, 0.9, 1.0, 1.0, // Right window - light blue 0.7, 0.9, 1.0, 1.0, 0.7, 0.9, 1.0, 1.0, 0.7, 0.9, 1.0, 1.0, 0.7, 0.9, 1.0, 1.0, ]; gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW); // Element array buffer for indexed drawing const indexBuffer = gl.createBuffer(); gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer); const indices = [ 0, 1, 2, 0, 2, 3, // House wall (two triangles) 4, 5, 6, // Roof (one triangle) 7, 8, 9, 7, 9, 10, // Chimney 11, 12, 13, 11, 13, 14, // Door 15, 16, 17, 15, 17, 18, // Left window 19, 20, 21, 19, 21, 22, // Right window ]; gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW); return { position: positionBuffer, color: colorBuffer, indices: indexBuffer, vertexCount: indices.length, }; } // Draw the scene function drawScene(gl, programInfo, buffers) { // Set clear color (sky blue) gl.clearColor(0.53, 0.81, 0.98, 1.0); gl.clearDepth(1.0); gl.enable(gl.DEPTH_TEST); gl.depthFunc(gl.LEQUAL); // Clear canvas gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // Set viewport gl.viewport(0, 0, gl.canvas.width, gl.canvas.height); // Create ortho projection matrix const projectionMatrix = mat4.create(); const aspect = gl.canvas.width / gl.canvas.height; // Use orthographic projection for 2D view mat4.ortho(projectionMatrix, -aspect, aspect, -1.0, 1.0, 0.1, 100.0); // Set the drawing position const modelViewMatrix = mat4.create(); // Move back a bit to view whole scene mat4.translate(modelViewMatrix, modelViewMatrix, [0.0, 0.0, -3.0]); // Bind position buffer { gl.bindBuffer(gl.ARRAY_BUFFER, buffers.position); gl.vertexAttribPointer( programInfo.attribLocations.vertexPosition, 3, // numComponents gl.FLOAT, // type false, // normalize 0, // stride 0 // offset ); gl.enableVertexAttribArray(programInfo.attribLocations.vertexPosition); } // Bind color buffer { gl.bindBuffer(gl.ARRAY_BUFFER, buffers.color); gl.vertexAttribPointer( programInfo.attribLocations.vertexColor, 4, // numComponents gl.FLOAT, // type false, // normalize 0, // stride 0 // offset ); gl.enableVertexAttribArray(programInfo.attribLocations.vertexColor); } // Bind element array buffer gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffers.indices); // Use the program gl.useProgram(programInfo.program); // Set uniforms gl.uniformMatrix4fv( programInfo.uniformLocations.projectionMatrix, false, projectionMatrix ); gl.uniformMatrix4fv( programInfo.uniformLocations.modelViewMatrix, false, modelViewMatrix ); // Draw the elements gl.drawElements( gl.TRIANGLES, buffers.vertexCount, gl.UNSIGNED_SHORT, 0 ); } // Simple mat4 library (since we don't load glMatrix) const mat4 = { create: function() { return new Float32Array([ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]); }, translate: function(out, a, v) { const x = v[0], y = v[1], z = v[2]; out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; out[13] = |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>WebGL House with Chimney</title> <style> body, html { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; } canvas { display: block; width: 100%; height: 100%; } </style> </head> <body> <canvas id="glCanvas"></canvas> <script> window.onload = function() { const canvas = document.getElementById('glCanvas'); // Make canvas match window size canvas.width = window.innerWidth; canvas.height = window.innerHeight; // Initialize WebGL context const gl = canvas.getContext('webgl'); if (!gl) { alert('WebGL not supported in your browser!'); return; } // Vertex shader program const vsSource = ` attribute vec4 aVertexPosition; attribute vec4 aVertexColor; uniform mat4 uModelViewMatrix; uniform mat4 uProjectionMatrix; varying lowp vec4 vColor; void main() { gl_Position = uProjectionMatrix * uModelViewMatrix * aVertexPosition; vColor = aVertexColor; } `; // Fragment shader program const fsSource = ` precision mediump float; varying lowp vec4 vColor; void main() { gl_FragColor = vColor; } `; // Create shader program const shaderProgram = initShaderProgram(gl, vsSource, fsSource); // Collect shader program info const programInfo = { program: shaderProgram, attribLocations: { vertexPosition: gl.getAttribLocation(shaderProgram, 'aVertexPosition'), vertexColor: gl.getAttribLocation(shaderProgram, 'aVertexColor'), }, uniformLocations: { projectionMatrix: gl.getUniformLocation(shaderProgram, 'uProjectionMatrix'), modelViewMatrix: gl.getUniformLocation(shaderProgram, 'uModelViewMatrix'), }, }; // Initialize buffers with house geometry const buffers = initBuffers(gl); // Draw the scene drawScene(gl, programInfo, buffers); // Handle window resize window.addEventListener('resize', function() { canvas.width = window.innerWidth; canvas.height = window.innerHeight; gl.viewport(0, 0, canvas.width, canvas.height); drawScene(gl, programInfo, buffers); }); }; // Initialize shader program function initShaderProgram(gl, vsSource, fsSource) { const vertexShader = loadShader(gl, gl.VERTEX_SHADER, vsSource); const fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fsSource); // Create the shader program const shaderProgram = gl.createProgram(); gl.attachShader(shaderProgram, vertexShader); gl.attachShader(shaderProgram, fragmentShader); gl.linkProgram(shaderProgram); // Check if creation succeeded if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { console.error('Unable to initialize the shader program: ' + gl.getProgramInfoLog(shaderProgram)); return null; } return shaderProgram; } // Create a shader of given type function loadShader(gl, type, source) { const shader = gl.createShader(type); gl.shaderSource(shader, source); gl.compileShader(shader); // Check if compilation succeeded if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { console.error('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(shader)); gl.deleteShader(shader); return null; } return shader; } // Initialize buffers for the house function initBuffers(gl) { // Create position buffer const positionBuffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer); // Define house geometry vertices const positions = [ // Main house (wall) -0.5, -0.3, 0.0, // Bottom left 0.5, -0.3, 0.0, // Bottom right 0.5, 0.3, 0.0, // Top right -0.5, 0.3, 0.0, // Top left // Roof (triangle) -0.6, 0.3, 0.0, // Left 0.6, 0.3, 0.0, // Right 0.0, 0.7, 0.0, // Top // Chimney 0.3, 0.3, 0.0, // Bottom left 0.45, 0.3, 0.0, // Bottom right 0.45, 0.6, 0.0, // Top right 0.3, 0.6, 0.0, // Top left // Door -0.15, -0.3, 0.0, // Bottom left 0.15, -0.3, 0.0, // Bottom right 0.15, 0.05, 0.0, // Top right -0.15, 0.05, 0.0, // Top left // Left window -0.35, 0.0, 0.0, -0.15, 0.0, 0.0, -0.15, 0.2, 0.0, -0.35, 0.2, 0.0, // Right window 0.15, 0.0, 0.0, 0.35, 0.0, 0.0, 0.35, 0.2, 0.0, 0.15, 0.2, 0.0, ]; gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW); // Color buffer const colorBuffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer); const colors = [ // House wall - beige 0.95, 0.87, 0.73, 1.0, 0.95, 0.87, 0.73, 1.0, 0.95, 0.87, 0.73, 1.0, 0.95, 0.87, 0.73, 1.0, // Roof - reddish 0.8, 0.3, 0.3, 1.0, 0.8, 0.3, 0.3, 1.0, 0.8, 0.3, 0.3, 1.0, // Chimney - brick red 0.6, 0.2, 0.2, 1.0, 0.6, 0.2, 0.2, 1.0, 0.6, 0.2, 0.2, 1.0, 0.6, 0.2, 0.2, 1.0, // Door - brown 0.55, 0.27, 0.07, 1.0, 0.55, 0.27, 0.07, 1.0, 0.55, 0.27, 0.07, 1.0, 0.55, 0.27, 0.07, 1.0, // Left window - light blue 0.7, 0.9, 1.0, 1.0, 0.7, 0.9, 1.0, 1.0, 0.7, 0.9, 1.0, 1.0, 0.7, 0.9, 1.0, 1.0, // Right window - light blue 0.7, 0.9, 1.0, 1.0, 0.7, 0.9, 1.0, 1.0, 0.7, 0.9, 1.0, 1.0, 0.7, 0.9, 1.0, 1.0, ]; gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW); // Element array buffer for indexed drawing const indexBuffer = gl.createBuffer(); gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer); const indices = [ 0, 1, 2, 0, 2, 3, // House wall (two triangles) 4, 5, 6, // Roof (one triangle) 7, 8, 9, 7, 9, 10, // Chimney 11, 12, 13, 11, 13, 14, // Door 15, 16, 17, 15, 17, 18, // Left window 19, 20, 21, 19, 21, 22, // Right window ]; gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW); return { position: positionBuffer, color: colorBuffer, indices: indexBuffer, vertexCount: indices.length, }; } // Draw the scene function drawScene(gl, programInfo, buffers) { // Set clear color (sky blue) gl.clearColor(0.53, 0.81, 0.98, 1.0); gl.clearDepth(1.0); gl.enable(gl.DEPTH_TEST); gl.depthFunc(gl.LEQUAL); // Clear canvas gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // Set viewport gl.viewport(0, 0, gl.canvas.width, gl.canvas.height); // Create ortho projection matrix const projectionMatrix = mat4.create(); const aspect = gl.canvas.width / gl.canvas.height; // Use orthographic projection for 2D view mat4.ortho(projectionMatrix, -aspect, aspect, -1.0, 1.0, 0.1, 100.0); // Set the drawing position const modelViewMatrix = mat4.create(); // Move back a bit to view whole scene mat4.translate(modelViewMatrix, modelViewMatrix, [0.0, 0.0, -3.0]); // Bind position buffer { gl.bindBuffer(gl.ARRAY_BUFFER, buffers.position); gl.vertexAttribPointer( programInfo.attribLocations.vertexPosition, 3, // numComponents gl.FLOAT, // type false, // normalize 0, // stride 0 // offset ); gl.enableVertexAttribArray(programInfo.attribLocations.vertexPosition); } // Bind color buffer { gl.bindBuffer(gl.ARRAY_BUFFER, buffers.color); gl.vertexAttribPointer( programInfo.attribLocations.vertexColor, 4, // numComponents gl.FLOAT, // type false, // normalize 0, // stride 0 // offset ); gl.enableVertexAttribArray(programInfo.attribLocations.vertexColor); } // Bind element array buffer gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffers.indices); // Use the program gl.useProgram(programInfo.program); // Set uniforms gl.uniformMatrix4fv( programInfo.uniformLocations.projectionMatrix, false, projectionMatrix ); gl.uniformMatrix4fv( programInfo.uniformLocations.modelViewMatrix, false, modelViewMatrix ); // Draw the elements gl.drawElements( gl.TRIANGLES, buffers.vertexCount, gl.UNSIGNED_SHORT, 0 ); } // Simple mat4 library (since we don't load glMatrix) const mat4 = { create: function() { return new Float32Array([ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]); }, translate: function(out, a, v) { const x = v[0], y = v[1], z = v[2]; out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; return out; }, ortho: function(out, left, right, bottom, top, near, far) { const lr = 1 / (left - right); const bt = 1 / (bottom - top); const nf = 1 / (near - far); out[0] = -2 * lr; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = 0; out[5] = -2 * bt; out[6] = 0; out[7] = 0; out[8] = 0; out[9] = 0; out[10] = 2 * nf; out[11] = 0; out[12] = (left + right) * lr; out[13] = (top + bottom) * bt; out[14] = (far + near) * nf; out[15] = 1; return out; } }; </script> </body> </html> |
Rendering the webpage gives the following image:
b"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x03\xb1\x00\x00\x03\xab\x08\x02\x00\x00\x00\x0e\x0c\x96\xf3\x00\x00\x17\xf7IDATx\x9c\xed\xda\xb1\xca\x1d\xf9}\xc7a\xadx\xb3\x10\x1c\x83\xde-\xe3F\xd6\x82]l\n\xc7{\x03\xf1\x82{\x93F\xb9\x03\xdf\x80]&\xed^\x81\x1bc\x07R\xaa\x0bi\x03\xbb\x17\x88\\H\x85\r+mcRE+\xb0\x03YY\x88\x14Z\xec\xb5\x8e\xa4\xf7\xbc\xe7\xcc\xcc\x7ff>\xcf\xd3\x9df\xf8\x15s\xe0\xc3\x97y\xe7\xe3\xfb\xcfn\x00\x00@\xd8\xcd\xd1\x07\x00\x00\xc0
\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x8c\xf4\xfe\xa7\xf7~\xf8\xcf\xff\xf8\xfe\xa7\xf7F\x1f\x02\x90\xf6\xce\xc7\xf7\x9f\x8d\xbe\x01\xa0\xe8\xbd\xcf\x1f\xde\xf9\xe4\xde\xe5\xe3\x07/\x7f~\xf1\xed\xbf{\xf4\xd1\xdd'\xb7?\x18{\x15@\x93&\x06\x18\xe0\xfdO\xef\xdd\xf9\xe45\xdb\xf0\xa3\x8f\xee~\xf6\x83\xbb\xcb\xdf\x03\x10\xa7\x89\x01\x16\xf5\xca<|\xc8\x0c\xb0<M\x0c\xb0\x9c7\xcd\xc3\x87\x0c\xc6\x00K\xd2\xc4\x00K\xb8r\x1e>d0\x06X\x8c&\x06\x98\xdd\xf1\xf3\xf0!\x831\xc0\x0241\xc0\x8cN\x98\x87\x0f\x19\x8c\x01\xe6\xa6\x89\x01\xe6r\xce<|\xc8
\x0c0\x1fM\x0c0\xbdI\xe6\xe1C\x06c\x80\x99hb\x80\x89M;\x0f\x1f2\x18\x03LN\x13\x03Lf\xa6y\xf8\x90\xc1\x18Z\x9a\x18
\x1as\xcf\xc3\x87\x0c\xc6\x00S\xd1\xc4\x00\xe7Zl\x1e>d0\x06\x98\x84&\x068\xcb\xf2\xf3\xf0!\x831\xc0\x9941\xc0\x89\x06\xce\xc3\x87\x0c\xc6\x00\xe7\xd0\xc4\x00\xa7X\xc3<|\xc8\x0cp\x1aM\x0cp=\xab\x9a\x87\x0f\x19\x8c\x01N\xa0\x89\x01\xaea\x9d\xf3\xf0!\x831\xc0\xb5hb\x80\xa3\xac|\x1e>d0\x068\x9e&\x06\xb8\xdaV\xe6\xe1C\x06c\x80chb\x80\xb7\xd9\xdc<|\xc8
\x0cp%M\x0c\xf0F\xdb\x9d\x87\x0f\x19\x8c\x01\xdeB\x13\x03\xbc\xc6\x0e\xe6\xe1C\x06c\x807\xd1\xc4\x00\xaf\xda\xd3<|\xc8\x0cpH\x13\x03\xfc\xd9.\xe7\xe1C\x06c\x80Whb\x80\xaf\xec{\x1e>d0\x06\xf8\x13M\x0cP\x99\x87\x0f\x19\x8c\x01^\xd2\xc4@]m\x1e>d0\x06\xd0\xc4@Wv\x1e>d0\x06\xe241\x10e\x1e>d0\x06\xb241\x90c\x1e~\x0b\x831\xd0\xa4\x89\x81\x16\xf3\xf01\x0c\xc6@\x8d&\x06*\xcc\xc3\xd7b0\x06R41\x90
\x1e>\x8d\xc1\x18\x88\xd0\xc4\xc0\xce\x99\x87\xcfd0\x06\n41\xb0g\xe6\xe1\xa9\x18\x8c\x81}\xd3\xc4\xc0>\x99\x87'g0\x06vL\x13\x03;d\x1e\x9e\x8f\xc1\x18\xd8%M\x0c\xec\x8ayx\x01\x06c\x7f41\xb0\x1f\xe6\xe1%\x19\x8c\x81=\xd1\xc4\xc0\x1e\x98\x87\x870\x18\x03\xbb\xa1\x89\x81\xcd3\x0f\x8fe0\x06v@\x13\x03\x1bf\x1e^\t\x831\xb0u\x9a\x18\xd8*\xf3\xf0\xda\x18\x8c\x81\xed\xd2\xc4\xc0\xf6\x98\x87W\xcb
\x0cl\x94&\x066\xc6<\xbc~\xbb\x1c\x8c\xff\xea7\xf7G\x9f0\xbd?~\xf7\xefG\x9f\x00kq1\xfa\x00\x80c\x99\x87\xb7\xe2\xce'\xf7.\x1f?\xdc\xd9\xfc\xd7\xff\xf1\x8b\x8b\xdf\xfc\xd7\xe8+\xa6\xf4\xfc\xbb\xdf\xff\xe3O\x7f6\xfa\nX\x0bM\x0cl\x83yx[.\x1f?\xf8\xf0\x97\x0fv9\x18\x03\xbb\xa4\x89\x81\xb53\x0fo\xd7.\x07c
\x9741\xb0j\xe6\xe1\xad3\x18\x03\x9b\xa0\x89\x81\x952\x0f\xef\x89\xc1\x18X9M\x0c\xac\x91yx\x7f\x0c\xc6\xc0\x9aib]\xcc\xc3\xfbf0\x06\xd6I\x13\x03+b\x1e.0\x18\x03+\xa4\x89\x81U0\x0f\xd7\x18\x8c\x81U\xd1\xc4\xc0x\xe6\xe1&\x831\xb0\x1e\x9a\x18\x18\xc9<\x8c\xc1\x18X\x03M\x0c\x0cc\x1e\xe6%\x8310\x9c&\x06\x060\x0fs\xc8
\x0c\x0c\xa4\x89\x81\xa5\x99\x87y\x13\x8310\x8a&\x06\x96c\x1e\xe6\x18\x06cy\x9a\x18X\x88y\x98\xe3\x19\x8c\x81\x85ib
v\xe6aNc0\x06\x16\xa3\x89\x81y\x99\x879\x87\xc1\x18X\x86&\x06\xe6b\x1ef\x06cn\x9a\x18\x98\x85y\x98i\x19\x8c\x81Yib
b\xe6a\xe6c0\x06f\xa2\x89\x81)\x99\x87\x99\x9b\xc1\x18\x98\x83&\x06\xa6a\x1efI\x06cZ\x9a\x18\x98\x80y\x98\xe5\x19\x8c\x81\tib\xe0,\xe6a\xc62\x18\x03\x93\xd0\xc4\xc0\xe9\xcc\xc3\xac\x81\xc1\x188\x9f&\x06Na\x1efm\x0c\xc6\xc0941pm\xe6a\xd6\xc9
\x0c\x9cL\x13\x03\xd7\x1ef\xfd\x0c\xc6\xc0\t41p,\xf30[a0\x06\xaeK\x13\x03W3\x0f\xb3E\x06c\xe0x\x9a\x18\xb8\x82y\x98\xed2\x18\x03G\xd2\xc4\xc0\x1b\x99\x87\xd9\x07\x831p%M\x0c\xbc\x9ey\x98=1\x18\x03o\xa7\x89\x81W\x99\x87\xd9+\x831\xf0&\x9a\x18\xf8\x0b\xe6a\xf6\xcd
\x0c\xbc\x96&\x06\xbeb\x1e\xa6\xc3\x0c\xbcB\x13\x037n\x98\x87\xe91\x18\x03_\xa7\x89\xa1\xce<L\x99\xc1\x18xI\x13C\x9ay\x18\x0c\xc6\xc0\rM\x0cY\xe6a\xf8:\x831\xc4ib(2\x0f\xc3!\x831\x94ibh1\x0f\xc3\xdb\x19\x8c\xa1I\x13C\x88y\x18\x8ea0\x86 M\x0c\t\xe6a\xb8.\x831\xa4hb\xd8?\xf30\x9c\xc6
\x0c\x1d\x9a\x18\xf6\xcc<\x0c\xe7{9\x18\xffv\xf4\x19\xc0\xac41\xec\x96y\x18\xa6r\xf9\xf8\xc1\xe5\x93'\xbf\x1f}\x060\x1fM\x0c;d\x1e\x06\x80k\xd1\xc4\xb07\xe6a\x00\xb8.M\x0c\xfba\x1e\x06\x80\xd3hb\xd8\t\xf30\x00\x9cL\x13\xc3\xe6\x99\x87\x01\xe0L\x9a\x18\xb6\xcd<\x0c\x00\xe7\xd3\xc4\xb0U\xe6a\x00\x98\x8a&\x86M2\x0f\x03\xc0\x8441l\x8cy\x18\x00&\xa7\x89aK\xcc\xc3\x000\x07M\x0c\xdb\x1e\x06\x80\xf9hb\xd8\x00\xf30\x00\xccJ\x13\xc3\xaa\x99\x87\x01
\x01\x9a\x18\xd6\xcb<\x0c\x00\xcb\xd0\xc4\xb0F\xe6a\x00X\x92&\x86\xd51\x0f\x03\xc0\xc241\xac\x88y\x18\x00\x86\xd0\xc4\xb0\x16\xe6a\x00\x18E\x13\xc3x\xe6a\x00\x18K\x13\xc3\xe6a\x00\x18N\x13\xc30\xe6a\x00X\tM\x0cc\x98\x87\x01
=41,\xcd<\x0c\x00k\xa3\x89aQ\xe6a\x00X!M\x0c\x0b1\x0f\x03\xc0jibX\x82y\x18\x00\xd6L\x13\xc3\xbc\xcc\xc3\x00\xb0~\x9a\x18fd\x1e\x06\x80M\xd0\xc40\x0b\xf30\x00l\x88&\x86\xe9\x99\x87\x01[41L\xc9<\x0c\x00[\xa4\x89a2\xe6a\x00\xd8(M\x0c\x130\x0f\x03\xc0\xa6ib8\x97y\x18\x00\xb6N\x13\xc3\xe9\xcc\xc3\x00\xb0\x0f\x9a\x18Nd\x1e\x06\x80\xdd\xd0\xc4pm\xe6a\x00\xd8\x19M\x0c\xd7c\x1e\x06\x80\xfd\xd1\xc4p,\xf30\x00\xec\x95&\x86\xa3\x98\x87\x01
\xc741\\xc1<\x0c\x00\xbb\xa7\x89\xe1m\xcc\xc3\x00P\xa0\x89\xe1\xf5\xcc\xc3\x00\xd0\xa1\x89\xe15\xcc\xc3\x00\x90\xa2\x89\xe1/\x98\x87\x01 H\x13\xc3\x9f\x99\x87\x01\xa0I\x13\xc3\x8d\x1b\xe6a\xa0\xe7\xf2\xf3\x87\xdf\xf9\xd7\x7fy\xf4\xd1\xdd'\xb7?\x18}\x0b\x8c\xa7\x89\xc1<\x0cD]>~\xf0\xe1/\x1f<\xfa\xe8\xeeg?\xb8;\xfa\x16\x18L\x13\x93f\x1e\x06\xb8\xf3\xc9\xbd\xcb\xc7\x0f\r\xc6\xc4ib\xba\xcc\xc3\x00/\x19\x8cA\x13Sd\x1e\x068d0\xa6L\x13\x93c\x1e\x06x\x13\x831Y\x9a\x98\x10\xf30\xc01\x0c\xc6\x04ib\xcc\xc3\x00\xc73\x18S\xa3\x89\xd9?\xf30\xc0i\x0c\xc6thbv\xce<\x0cp\x0e\x831\x11\x9a\x98\xdd2\x0f\x03L\xc5\xcc\xeeib\xf6\xc9<\x0c0-\x831\xfb\xa6\x89\xd9\x1b\xf30\xc0|\x0c\xc6\xec\x95&fW\xcc\xc3\x00s3\x18\xb3K\x9a\x98\x9d0\x0f\x03,\xc9
\xcc\xcehb\xf6\xc0<\x0c\xb0<\x831{\xa2\x89\xd96\xf30\xc0X\x06c\xf6A\x13\xb3a\xe6a\x8050\x18\xb3\x03\x9a\x98M2\x0f\x03\xac\x8d\xc1\x98M\xd3\xc4l\x8fy\x18\x9d\x0c\xc6l\x97&fK\xcc\xc3\x00\xebg0f\x8b41\x9ba\x1e\x06\xd8\n\x831\x9b\xa3\x89\xd9\x00\xf30\xc0\x16\x19\x8c\xd9\x10M\xcc\xda\x99\x87\x01\xb6\xcb
\xccVhb\xd6\xcb<\x0c\xb0\x0f\x06c\xd6O\x13\xb3R\xe6a\x80=1\x18\xb3r\x9a\x98\xd51\x0f\x03\xec\x95\xc1\x98\xd5\xd2\xc4\xac\x8by\x18\xdf\x0c\xc6\xac\x93&f-\xcc\xc3\x00\x1d\x06c\xd6F\x13\xb3\n\xe6a\x80\x1a\x831\xab\xa2\x89\x19\xcc<\x0cPf0f%41#\x99\x87\x010\x18\xb3\x06\x9a\x981\xcc\xc3\x00|\x9d\xc1\x98\xb141\x03\x98\x87\x018d0f M\xcc\xa2\xcc\xc3\x00\xbc\x9d\xc1\x98!41\xcb1\x0f\x03p\x0c\x831\xcb\xd3\xc4,\xc1<\x0c\xc0u\x19\x8cY\x92&fv\xe6a\x00Nc0f1\x9a\x98\x19\x99\x87\x018\x9f\xc1\x98\x05hb\xe6b\x1e\x06
*\x06c\xe6\xa6\x89\x99\x9ey\x18\x809\x18\x8c\x99\x8f&fb\xe6a\x00\xe6c0f&\x9a\x98\xc9\x98\x87\x01X\x86\xc1\x98\xc9ib\xa6a\x1e\x06I\x06c\xa6\xa5\x899\x97y\x18\x80Q\x0c\xc6LE\x13s\x16\xf30\x00c\x19\x8c\x99\xc4;\x1f\xdf\x7f6\xfa\x066\xe9\xbd\xcf\x1f^>~p\xf9\xf8\xe1\xe8C\xbe\xf2\xad\x8b\xa7\xa3O\x00\xf6\xec\xbf\xff\xf0\x87\xdf\x7f\xf9\xe5\xe8+\xa6\xf47\xef\xbe\xfb\xb7\xdf\xfc\xe6\xf9\xcf\xf9\xdd\xf3[\xe7?d\x12_|\xfb\x03Y\xcc\xc941{\xf0\xad\x8b\xa7?\xfa\xc6\xafG_\x01P\xf4\xef\xff\xfb\xbd\xf5d1\x9c\xec\xe6\xe8\x03\x00\x00
0M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xd3\xc4\x00\x00\xd4ib\x00\x00\xea41\x00\x00u\x9a\x18\x00\x80:M\x0c\x00@\x9d&\x06\x00\xa0N\x13\x03\x00P\xa7\x89\x01\x00\xa8\xbb\x18}\x00\xf0zOo\xbe7\xfa\x84\x95\xba\xf5\xe2\xc9\xe8\x13\xb8\x9a\x17\xf8M\xbc\xc0\xb0N\x9a\x18V\xea\xf3\x8b;Oo^\x8e\xbeb\x8d\xfe\xe1\xff\xfes\xf4\t\\xed\xd7\xef~8\xfa\x845\xba\
This is a screenshot of a webpage that draws something with webgl. I'm trying to see if it drew what I wanted. Describe what is drawn in this image?
The image depicts a simple, stylized house. It has a beige rectangular base with two light blue squares representing windows. The roof is a red triangle, and there is a brown rectangle in the center, likely representing a door. Additionally, there is a red rectangle on the roof, which could be a chimney. The background is a solid light blue color.
Does this answer say that there is a picture of a house with a chimney "The image depicts a simple, stylized house. It has a beige rectangular base with two light blue squares representing windows. The roof is a red triangle, and there is a brown rectangle in the center, likely representing a door. Additionally, there is a red rectangle on the roof, which could be a chimney. The background is a solid light blue color."? Answer "Yes it does" or "No it does not".
Yes it does.
Testing if the previous output contains the string es it does
: True
Testing if the previous output contains the string THREE.
: False