本文整理汇总了C#中WebGLRenderingContext.lineWidth方法的典型用法代码示例。如果您正苦于以下问题:C# WebGLRenderingContext.lineWidth方法的具体用法?C# WebGLRenderingContext.lineWidth怎么用?C# WebGLRenderingContext.lineWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebGLRenderingContext
的用法示例。
在下文中一共展示了WebGLRenderingContext.lineWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Application
//.........这里部分代码省略.........
var mvMatLoc = gl.getUniformLocation(prog, "mvMatrix");
var colorLoc = gl.getUniformLocation(prog, "u_color");
var line_prog = gl.createProgram(
new LineVertexShader(),
new LineFragmentShader()
);
var lineLoc = 2U;
gl.bindAttribLocation(line_prog, lineLoc, "aPos");
gl.linkProgram(line_prog);
gl.useProgram(line_prog);
gl.uniformMatrix4fv(gl.getUniformLocation(line_prog, "prMatrix"),
false, new Float32Array(prMatrix.getAsArray()));
var mvMatLineLoc = gl.getUniformLocation(line_prog, "mvMatrix");
var pt1 = new float[]{2,1,1, -2,1,1, 2,-1,1, -2,-1,1, 2,1,-1, -2,1,-1, 2,-1,-1, -2,-1,-1,
1,2,1, 1,-2,1, 1,2,-1, 1,-2,-1, -1,2,1, -1,-2,1, -1,2,-1, -1,-2,-1,
1,1,2, 1,1,-2, -1,1,2, -1,1,-2, 1,-1,2, 1,-1,-2, -1,-1,2, -1,-1,-2
};
gl.enableVertexAttribArray(lineLoc);
gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(pt1), gl.STATIC_DRAW);
gl.vertexAttribPointer(lineLoc, 3, gl.FLOAT, false, 0, 0);
gl.enable(gl.DEPTH_TEST);
gl.depthFunc(gl.LEQUAL);
gl.clearDepth(1.0f);
gl.clearColor(.5f, 1f, .5f, 1f);
gl.lineWidth(2);
var xOffs = 0;
var yOffs = 0;
var drag = 0;
var xRot = 0f;
var yRot = 0f;
var transl = -6.0f;
#region drawBall
Action<f, f, f> drawBall = (x, y, z) =>
{
mvMatrix.makeIdentity();
mvMatrix.translate(x, y, z);
mvMatrix.multRight(rotMat);
mvMatrix.translate(0, 0, transl);
gl.uniformMatrix4fv(mvMatLoc, false,
new Float32Array(mvMatrix.getAsArray()));
gl.drawElements(gl.TRIANGLES, 6 * nPhi * nTheta, gl.UNSIGNED_SHORT, 72);
};
#endregion
#region drawScene
Action drawScene = delegate
{
gl.viewport(0, 0, gl_viewportWidth, gl_viewportWidth);
gl.useProgram(prog);