diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/webglrenderingcontext/uniformmatrix | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/webglrenderingcontext/uniformmatrix')
-rw-r--r-- | files/zh-cn/web/api/webglrenderingcontext/uniformmatrix/index.html | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/webglrenderingcontext/uniformmatrix/index.html b/files/zh-cn/web/api/webglrenderingcontext/uniformmatrix/index.html new file mode 100644 index 0000000000..57669ab170 --- /dev/null +++ b/files/zh-cn/web/api/webglrenderingcontext/uniformmatrix/index.html @@ -0,0 +1,81 @@ +--- +title: 'WebGLRenderingContext.uniformMatrix[234]fv()' +slug: Web/API/WebGLRenderingContext/uniformMatrix +tags: + - WebGL + - WebGLAPI + - WebGLRenderingContext + - uniformMatrix2fv + - uniformMatrix3fv + - uniformMatrix4fv + - 矩阵 +translation_of: Web/API/WebGLRenderingContext/uniformMatrix +--- +<div>{{APIRef("WebGL")}}</div> + +<p><a href="/en-US/docs/Web/API/WebGL_API">WebGL API</a> 的<strong><code>WebGLRenderingContext.uniformMatrix[234]fv()</code></strong> 方法为 uniform variables 指定了矩阵值 .</p> + +<p>该方法的3个版本 (<code>uniformMatrix2fv()</code>, <code>uniformMatrix3fv()</code>, 和<code>unifomMatrix4fv()</code>) ,分别以二阶,三阶,和四阶方阵作为输入值,它们应是分别具有4,9,16个浮点数的数组.</p> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox"><em>WebGLRenderingContext</em>.uniformMatrix2fv(<em>location</em>, <em>transpose</em>, <em>value</em>); +<em>WebGLRenderingContext</em>.uniformMatrix3fv(<em>location</em>, <em>transpose</em>, <em>value</em>); +<em>WebGLRenderingContext</em>.uniformMatrix4fv(<em>location</em>, <em>transpose</em>, <em>value</em>); +</pre> + +<h3 id="参数">参数</h3> + +<dl> + <dt><code>location</code></dt> + <dd>{{domxref("WebGLUniformLocation")}} 对象包含了要修改的 uniform attribute位置. 位置使用 {{domxref("WebGLRenderingContext.getUniformLocation", "getUniformLocation()")}}获得.</dd> + <dt><code>transpose</code></dt> + <dd>{{domxref("GLboolean")}} 指定是否转置矩阵。必须为 <code>false</code>.</dd> + <dt><code>value</code></dt> + <dd> + <p> {{jsxref("Float32Array")}} 型或者是 <code>GLfloat</code> 序列值.假定值以列主要顺序提供.</p> + </dd> +</dl> + +<h3 id="返回值">返回值</h3> + +<p><code>undefined</code></p> + +<h2 id="示例">示例</h2> + +<pre class="brush: js">gl.uniformMatrix2fv(loc, false, [2,1, 2,2]);</pre> + +<h2 id="说明">说明</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('WebGL', "#5.14.10", "uniformMatrix")}}</td> + <td>{{Spec2('WebGL')}}</td> + <td>Initial definition.</td> + </tr> + <tr> + <td>{{SpecName('OpenGL ES 2.0', "glUniform.xml", "glUniform")}}</td> + <td>{{Spec2('OpenGL ES 2.0')}}</td> + <td>Man page of the OpenGL API.</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> + +<p>{{Compat("api.WebGLRenderingContext.uniformMatrix2fv")}}</p> + +<h2 id="另见">另见</h2> + +<ul> + <li>{{domxref("WebGLRenderingContext.uniform()")}}</li> + <li>{{domxref("WebGL2RenderingContext.uniformMatrix()")}} – WebGL 2 versions of these methods.</li> +</ul> |