codecamp

three.js BufferAttribute Types

在 three.js 中一共有 9 种 BufferAttribute。每种和 JavaScript 中的类型相对应。 Typed Arrays.

THREE.Float64BufferAttribute
THREE.Float32BufferAttribute
THREE.Float16BufferAttribute
THREE.Uint32BufferAttribute
THREE.Int32BufferAttribute
THREE.Uint16BufferAttribute
THREE.Int16BufferAttribute
THREE.Uint8ClampedBufferAttribute
THREE.Uint8BufferAttribute
THREE.Int8BufferAttribute

构造函数

所有上述内容都以相同的方式调用。

TypedBufferAttribute( array : Array, itemSize : Integer, normalized : Boolean )

array -- 该值可以是类型化或非类型化的(普通)数组。 它将被转换为指定的类型。 如果给定长度,将创建一个新的 TypedArray,并将所有元素初始化为零。

itemSize -- 应与特定顶点关联的数组值的数量。

normalized -- (可选)表示缓冲区中的基础数据如何映射到GLSL代码中的值。

属性

继承属性详见 BufferAttribute。

方法

继承方法详见 BufferAttribute。

源代码

src/core/BufferAttribute.js


three.js Uniform
three.js Earcut
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

参考

核心 / BufferAttributes

渲染器 / WebXR

开发者参考

WebGL渲染器

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }