Logo Search packages:      
Sourcecode: wims version File versions  Download package

void Matrix3D::transform ( float  v[],
int  tv[],
int  nvert 
) [inline, package]

Transform nvert points from v into tv. v contains the input coordinates in floating point. Three successive entries in the array constitute a point. tv ends up holding the transformed points as integers; three successive entries per point

Definition at line 207 of file Matrix3D.java.

Referenced by XYZChemModel::transform(), Model3D::transform(), and XYZLatModel::transform().

                                                   {
      float lxx = xx, lxy = xy, lxz = xz, lxo = xo;
      float lyx = yx, lyy = yy, lyz = yz, lyo = yo;
      float lzx = zx, lzy = zy, lzz = zz, lzo = zo;
      for (int i = nvert * 3; (i -= 3) >= 0;) {
          float x = v[i];
          float y = v[i + 1];
          float z = v[i + 2];
          tv[i    ] = (int) (x * lxx + y * lxy + z * lxz + lxo);
          tv[i + 1] = (int) (x * lyx + y * lyy + z * lyz + lyo);
          tv[i + 2] = (int) (x * lzx + y * lzy + z * lzz + lzo);
      }
    }


Generated by  Doxygen 1.6.0   Back to index