From 1bcb5506726f4c01957f65ebddbde6816300e50d Mon Sep 17 00:00:00 2001 From: pyjong1999 <pyjong1999@gmail.com> Date: Thu, 6 Jun 2024 01:03:28 +0900 Subject: [PATCH] save3 --- example/project.js | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/example/project.js b/example/project.js index 723eddd..9ea8fd4 100644 --- a/example/project.js +++ b/example/project.js @@ -420,26 +420,6 @@ function cube(color) gl.enableVertexAttribArray(vNormal); } -/// 백그라운드 이미지용 -var texture; - -function configureTexture(image) { - texture = gl.createTexture(); - gl.bindTexture(gl.TEXTURE_2D, texture); - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image); - gl.generateMipmap(gl.TEXTURE_2D); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_LINEAR); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); -} - -function initTexture() { - var image = new Image(); - image.onload = function() { - configureTexture(image); - } - image.src = 'D:\\vscode\\computergraphics\\example\\img.jpg'; // 배경 이미지 파일 경로 -} function renderBackground() { gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); @@ -487,7 +467,6 @@ window.onload = function init() { program = initShaders(gl, "vertex-shader", "fragment-shader"); gl.useProgram(program); - initTexture(); instanceMatrix = mat4(); @@ -894,7 +873,6 @@ var render = function() { walk(); //headmove(); } - renderBackground(); traverse(torsoId); requestAnimFrame(render); -- GitLab