當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript mat4.fromValues方法代碼示例

本文整理匯總了TypeScript中gl-matrix.mat4.fromValues方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript mat4.fromValues方法的具體用法?TypeScript mat4.fromValues怎麽用?TypeScript mat4.fromValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gl-matrix.mat4的用法示例。


在下文中一共展示了mat4.fromValues方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: createBoneMatrix

  static createBoneMatrix(
    basis: mat3,
    center: vec3,
    isLeft: boolean
  ): mat4 {
    const t = mat4.fromValues(
      basis[0], basis[1], basis[2], center[0],
      basis[3], basis[4], basis[5], center[1],
      basis[6], basis[7], basis[8], center[2],
      0,        0,        0,        0
    );

    // flip the basis to be right-handed
    if (isLeft) {
      t[0] *= -1;
      t[1] *= -1;
      t[2] *= -1;
    }

    return t;
  }
開發者ID:alexeden,項目名稱:dotstar-node,代碼行數:21,代碼來源:bone.ts

示例2: Float32Array

let vecArray = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);

let vec2A = vec2.fromValues(1, 2);
let vec2B = vec2.fromValues(3, 4);
let vec3A = vec3.fromValues(1, 2, 3);
let vec3B = vec3.fromValues(3, 4, 5);
let vec4A = vec4.fromValues(1, 2, 3, 4);
let vec4B = vec4.fromValues(3, 4, 5, 6);
let mat2A = mat2.fromValues(1, 2, 3, 4);
let mat2B = mat2.fromValues(1, 2, 3, 4);
let mat2dA = mat2d.fromValues(1, 2, 3, 4, 5, 6);
let mat2dB = mat2d.fromValues(1, 2, 3, 4, 5, 6);
let mat3A = mat3.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9);
let mat3B = mat3.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9);
let mat4A = mat4.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
let mat4B = mat4.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
let quatA = quat.fromValues(1, 2, 3, 4);
let quatB = quat.fromValues(5, 6, 7, 8);

let outVec2 = vec2.create();
let outVec3 = vec3.create();
let outVec4 = vec4.create();
let outMat2 = mat2.create();
let outMat2d = mat2d.create();
let outMat3 = mat3.create();
let outMat4 = mat4.create();
let outQuat = quat.create();

let outMat2Null: mat2 | null;
let outMat2dNull: mat2d | null;
開發者ID:DenisCarriere,項目名稱:DefinitelyTyped,代碼行數:30,代碼來源:gl-matrix-tests.ts


注:本文中的gl-matrix.mat4.fromValues方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。