HTML: Markup language
CSS: Styling language
JavaScript: Scripting language
Web APIs: Programming interfaces
All web technology
Learn web development
Discover our tools
Get to know MDN better
此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。
View in English Always switch to English
自 2015年7月 起,此特性已在主流浏览器中得到支持,可在大多数设备和浏览器版本中正常使用。
WebGL API 的 WebGLRenderingContext.bindAttribLocation() 方法将通用顶点索引绑定到属性变量。
WebGLRenderingContext.bindAttribLocation()
void gl.bindAttribLocation(program, index, name);
program
要绑定的WebGLProgram 对象。
WebGLProgram
index
GLuint 指定要绑定的通用顶点的索引。
GLuint
name
DOMString指定要绑定到通用顶点索引的变量的名称。该名称不能以“webgl_”或“_webgl_”开头,因为这些名称将保留供 WebGL 使用。
DOMString
无。
gl.bindAttribLocation(program, colorLocation, 'vColor');
启用 JavaScript 以查看此浏览器兼容性表。
WebGLRenderingContext.getActiveAttrib()
WebGLRenderingContext.getAttribLocation()
WebGLRenderingContext.getVertexAttrib()