webgl-programming-guide/common/matrix4.js
/**
   * Multiply the three-dimensional vector.
   * @param {Matrix4} pos  The multiply vector
   * @return {Vector3} The result of multiplication(Float32Array)
   */
Multiply the three-dimensional vector.
@param {Matrix4} pos  The multiply vector
@return {Vector3} The result of multiplication(Float32Array)
Multiply the three - dimensional vector . @param { Matrix4 } pos The multiply vector @return { Vector3 } The result of multiplication ( Float32Array )
multiplyVector3(pos) {
    let e = this.elements
    let p = pos.elements
    let v = new Vector3()
    let result = v.elements
    result[0] = p[0] * e[0] + p[1] * e[4] + p[2] * e[ 8] + e[12]
    result[1] = p[0] * e[1] + p[1] * e[5] + p[2] * e[ 9] + e[13]
    result[2] = p[0] * e[2] + p[1] * e[6] + p[2] * e[10] + e[14]
    return v
  }
multiplyVector3 ( pos ) { let e = this . elements let p = pos . elements let v = new Vector3 ( ) let result = v . elements result [ 0 ] = p [ 0 ] * e [ 0 ] + p [ 1 ] * e [ 4 ] + p [ 2 ] * e [ 8 ] + e [ 12 ] result [ 1 ] = p [ 0 ] * e [ 1 ] + p [ 1 ] * e [ 5 ] + p [ 2 ] * e [ 9 ] + e [ 13 ] result [ 2 ] = p [ 0 ] * e [ 2 ] + p [ 1 ] * e [ 6 ] + p [ 2 ] * e [ 10 ] + e [ 14 ] return v }
Multiply the three-dimensional vector.
Multiply the three - dimensional vector .