{"id":17224,"date":"2026-09-08T10:50:41","date_gmt":"2026-09-08T01:50:41","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=17224"},"modified":"2026-09-08T10:50:41","modified_gmt":"2026-09-08T01:50:41","slug":"three-js%ec%9d%98-tsl%ec%9d%84-%ec%9d%b4%ec%9a%a9%ed%95%9c-attribute-%ea%b4%80%eb%a0%a8-%ec%bd%94%eb%93%9c","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=17224","title":{"rendered":"three.js\uc758 TSL\uc744 \uc774\uc6a9\ud55c attribute \uad00\ub828 \ucf54\ub4dc"},"content":{"rendered":"<p>attribute\ub97c \uc704\ud55c \ub370\uc774\ud130\uc778 Buffer Attribte\ub97c \uc0dd\uc131\ud558\ub294 \ubc29\uc2dd\uc740 \uae30\uc874\uacfc \ub3d9\uc77c\ud569\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"javascript\">\r\nconst count = geometry.attributes.position.count\r\nconst randomArray = new Float32Array(count)\r\n\r\nfor (let i = 0; i < count; i++)\r\n    randomArray[i] = Math.random()\r\n\r\nconst randomBuffer = new THREE.BufferAttribute(randomArray, 1)\r\n\r\n\/\/ KEY POINT ->\r\ngeometry.setAttribute('random', randomBuffer)\r\nconst random = attribute('random')\r\n\/\/ <-\r\n\r\nmaterial.colorNode = random\r\n<\/pre>\n<p>\uc704\uc758 \ucf54\ub4dc\ub294 \ub2e4\uc74c \ucf54\ub4dc\ucc98\ub7fc \uc880\ub354 \uc9e7\uace0 \ud6a8\uacfc\uc801\uc73c\ub85c \ubcc0\uacbd\ub420 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"javascript\">\r\nconst count = geometry.attributes.position.count\r\nconst randomArray = new Float32Array(count)\r\n\r\nfor (let i = 0; i < count; i++)\r\n    randomArray[i] = Math.random()\r\n\r\nconst randomBuffer = new THREE.BufferAttribute(randomArray, 1)\r\n\r\n\/\/ KEY POINT ->\r\nconst random = bufferAttribute(randomBuffer, 'float')\r\n\/\/ <-\r\n\r\nmaterial.colorNode = random\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>attribute\ub97c \uc704\ud55c \ub370\uc774\ud130\uc778 Buffer Attribte\ub97c \uc0dd\uc131\ud558\ub294 \ubc29\uc2dd\uc740 \uae30\uc874\uacfc \ub3d9\uc77c\ud569\ub2c8\ub2e4. const count = geometry.attributes.position.count const randomArray = new Float32Array(count) for (let i = 0; i < count; i++) randomArray[i] = Math.random() const randomBuffer = new THREE.BufferAttribute(randomArray, 1) \/\/ KEY POINT -> geometry.setAttribute(&#8216;random&#8217;, randomBuffer) const random = attribute(&#8216;random&#8217;) \/\/ const random = bufferAttribute(randomBuffer, &#8216;float&#8217;) \/\/<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[145],"tags":[],"class_list":["post-17224","post","type-post","status-publish","format-standard","hentry","category-three-js"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/17224","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17224"}],"version-history":[{"count":2,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/17224\/revisions"}],"predecessor-version":[{"id":17226,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/17224\/revisions\/17226"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17224"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}