Esempio n. 1
0
 public Vector3f scalar_multiply(Vector3f A, float d)
 {
     scalar_multiply (A.v, d, v);
     return this;
 }
Esempio n. 2
0
 public Vector3f scalar_divide(Vector3f A, float d)
 {
     scalar_divide (A.v, d, v);
     return this;
 }
Esempio n. 3
0
 public Vector3f scalar_minus(Vector3f A, float d)
 {
     scalar_minus (A.v, d, v);
     return this;
 }
Esempio n. 4
0
 public Vector3f normalize(Vector3f A)
 {
     normalize (A.v, v);
     return this;
 }
Esempio n. 5
0
 public Vector3f negate(Vector3f A)
 {
     negate (A.v, v);
     return this;
 }
Esempio n. 6
0
 public Vector3f minus(Vector3f A, Vector3f B)
 {
     minus (A.v, B.v, v);
     return this;
 }
Esempio n. 7
0
 public Vector3f cross(Vector3f A, Vector3f B)
 {
     float [] C = v;
     if (A == this || B == this) C = new float [3];
     v = cross (A.v, B.v, C);
     return this;
 }
Esempio n. 8
0
        private void triangle(float [] x0, float [] x1, float [] x2, int type)
        {
            // TODO subdivide
            Vector3f A = new Vector3f (x0).normalize ();
            Vector3f B = new Vector3f (x1).normalize ();
            Vector3f C = new Vector3f (x2).normalize ();

            Vector3f AB = new Vector3f ().minus (A, B);
            Vector3f AC = new Vector3f ().minus (A, C);
            Vector3f n = new Vector3f ().cross (AC, AB).normalize ();

            gl.begin (type);
            gl.normal3fv (n.v);
            gl.vertex3fv (x0);
            gl.vertex3fv (x1);
            gl.vertex3fv (x2);
            gl.end ();
        }