《WebGL Beginner's Guide》的原文摘录

  • This scene consists of: A canvas through which we see the scene. A series of polygonal meshes (objects) that constitute the car: roof, windows, headlights, fenders, doors, wheels, spoiler, bumpers, and so on. Light sources; otherwise everything would appear black. A camera that determines where in the 3D world is our view point. The camera can be made interactive and the view point can change, depending on the user input. For this example, we were using the left and right arrow keys and the mouse to move the camera around the car. (查看原文)
    [已注销] 2012-07-31 16:22:45
    —— 引自第20页
  • Indices are numeric labels for the vertices in a given 3D scene. Indices allow us to tell WebGL how to connect vertices in order to produce a surface. (查看原文)
    [已注销] 2012-07-31 16:27:16
    —— 引自第23页
  • Attributes are input variables used in the vertex shader. For example, vertex coordinates,vertex colors, and so on. Due to the fact that the vertex shader is called on each vertex,the attributes will be different every time the vertex shader is invoked. Uniforms are input variables available for both the vertex shader and fragment shader. Unlike attributes, uniforms are constant during a rendering cycle. For example, lights position. Varyings are used for passing data from the vertex shader to the fragment shader. (查看原文)
    [已注销] 2012-07-31 16:34:16
    —— 引自第26页
  • buffer: var myBuffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, myBuffer); //VBO,gl.ELEMENT_ARRAY_BUFFER对应IBO gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW); 类型数组:Float32Array for VBOs and UInt16Array for IBOs? gl.bindBuffer(gl.ARRAY_BUFFER, null); //unbind; (查看原文)
    [已注销] 2012-07-31 19:21:06
    —— 引自第30页
  • 1、K is the correct matrix transform that keeps the normal vectors being perpendicular to the surface of the object. We call K the Normal matrix. 2、K is obtained by transposing the inverse of the Model-View matrix (M in this example). 3、We need to use K to multiply the normal vectors so they keep being perpendicular to surface when these are transformed. (查看原文)
    [已注销] 2012-12-04 16:50:54
    —— 引自第113页
  • WebGL 遵循分而治之的原则渲染对象。复杂的多边形分解为三角形,线段和点图元。然后,每个几何图元经过一系列步骤,由GPU并行处理,这个过程称之为渲染管线,并最终在canvas上生成最终视图 (查看原文)
    VickQi 2013-01-01 23:25:05
    —— 引自第23页