dojox/gfx3d/vector.js

  • Provides:

    • dojox.gfx3d.vector
  • dojox.gfx3d.vector.sum

    • type
      Function
    • source: [view]
        var v = {x: 0, y: 0, z:0};
        dojo.forEach(arguments, function(item){ v.x += item.x; v.y += item.y; v.z += item.z; });
        return v;
    • summary
      sum of the vectors
  • dojox.gfx3d.vector.center

    • type
      Function
    • source: [view]
        var l = arguments.length;
        if(l == 0){
         return {x: 0, y: 0, z: 0};
        }
        var v = dojox.gfx3d.vector.sum(arguments);
        return {x: v.x/l, y: v.y/l, z: v.z/l};
    • summary
      center of the vectors
  • dojox.gfx3d.vector.substract

    • type
      Function
    • parameters:
      • a: (typeof Pointer)
      • b: (typeof Pointer)
    • source: [view]
        return {x: a.x - b.x, y: a.y - b.y, z: a.z - b.z};
    • summary
  • dojox.gfx3d.vector._crossProduct

    • type
      Function
    • parameters:
      • x: (typeof Number)
        an x coordinate of a point
      • y: (typeof Number)
        a y coordinate of a point
      • z: (typeof Number)
        a z coordinate of a point
      • u: (typeof Number)
        an x coordinate of a point
      • v: (typeof Number)
        a y coordinate of a point
      • w: (typeof Number)
        a z coordinate of a point
    • source: [view]
        return {x: y * w - z * v, y: z * u - x * w, z: x * v - y * u}; // Object
    • summary
      applies a cross product of two vectorss, (x, y, z) and (u, v, w)
    • returns
      Object
  • dojox.gfx3d.vector.crossProduct

    • type
      Function
    • parameters:
      • a: (typeof Number||Point)
        Number: an x coordinate of a point
      • b: (typeof Number||Point)
        Number: a y coordinate of a point
      • c: (typeof Number, optional)
        Number: a z coordinate of a point
      • d: (typeof Number, optional)
        Number: an x coordinate of a point
      • e: (typeof Number, optional)
        Number: a y coordinate of a point
      • f: (typeof Number, optional)
        Number: a z coordinate of a point
    • source: [view]
        if(arguments.length == 6 && dojo.every(arguments, function(item){ return typeof item == "number"; })){
         return dojox.gfx3d.vector._crossProduct(a, b, c, d, e, f); // Object
        }
        // branch
        // a: Object: a point
        // b: Object: a point
        // c: null
        // d: null
        // e: null
        // f: null
        return dojox.gfx3d.vector._crossProduct(a.x, a.y, a.z, b.x, b.y, b.z); // Object
    • summary
      applies a matrix to a point
      matrix: dojox.gfx3d.matrix.Matrix3D: a 3D matrix object to be applied
    • returns
      Object
  • dojox.gfx3d.vector._dotProduct

    • type
      Function
    • parameters:
      • x: (typeof Number)
        an x coordinate of a point
      • y: (typeof Number)
        a y coordinate of a point
      • z: (typeof Number)
        a z coordinate of a point
      • u: (typeof Number)
        an x coordinate of a point
      • v: (typeof Number)
        a y coordinate of a point
      • w: (typeof Number)
        a z coordinate of a point
    • source: [view]
        return x * u + y * v + z * w; // Number
    • summary
      applies a cross product of two vectorss, (x, y, z) and (u, v, w)
    • returns
      Number
  • dojox.gfx3d.vector.dotProduct

    • type
      Function
    • parameters:
      • a: (typeof Number||Point)
        Number: an x coordinate of a point
      • b: (typeof Number||Point)
        Number: a y coordinate of a point
      • c: (typeof Number, optional)
        Number: a z coordinate of a point
      • d: (typeof Number, optional)
        Number: an x coordinate of a point
      • e: (typeof Number, optional)
        Number: a y coordinate of a point
      • f: (typeof Number, optional)
        Number: a z coordinate of a point
    • source: [view]
        if(arguments.length == 6 && dojo.every(arguments, function(item){ return typeof item == "number"; })){
         return dojox.gfx3d.vector._dotProduct(a, b, c, d, e, f); // Object
        }
        // branch
        // a: Object: a point
        // b: Object: a point
        // c: null
        // d: null
        // e: null
        // f: null
        return dojox.gfx3d.vector._dotProduct(a.x, a.y, a.z, b.x, b.y, b.z); // Object
    • summary
      applies a matrix to a point
      matrix: dojox.gfx3d.matrix.Matrix3D: a 3D matrix object to be applied
    • returns
      Object
  • dojox.gfx3d.vector.normalize

    • type
      Function
    • parameters:
      • a: (typeof Point||Array)
        Object: a point
      • b: (typeof Point)
        Object: a point
      • c: (typeof Point)
        Object: a point
    • source: [view]
        var l, m, n;
        if(a instanceof Array){
         l = a[0]; m = a[1]; n = a[2];
        }else{
         l = a; m = b; n = c;
        }


        var u = dojox.gfx3d.vector.substract(m, l);
        var v = dojox.gfx3d.vector.substract(n, l);
        return dojox.gfx3d.vector.crossProduct(u, v);
    • summary
      find the normal of the implicit surface
  • dojox.gfx3d.vector

    • type
      Object
    • summary
  • dojox.gfx3d

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary