Esempio n. 1
0
        public JCube(double length)
        {
            Vectors.Add(new JVector3(-length / 2, -length / 2, length / 2));
            Vectors.Add(new JVector3(length / 2, -length / 2, length / 2));
            Vectors.Add(new JVector3(length / 2, length / 2, length / 2));
            Vectors.Add(new JVector3(-length / 2, length / 2, length / 2));
            Vectors.Add(new JVector3(-length / 2, -length / 2, -length / 2));
            Vectors.Add(new JVector3(length / 2, -length / 2, -length / 2));
            Vectors.Add(new JVector3(length / 2, length / 2, -length / 2));
            Vectors.Add(new JVector3(-length / 2, length / 2, -length / 2));

            Position = new JVector3(0, 0, 0);

            Quaternion = new JQuaternion3D(0, 0, 0, 0);
        }
Esempio n. 2
0
 public static JVector3 Cross(JVector3 a, JVector3 b)
 {
     return(new JVector3(a.Y * b.Z - a.Z * b.Y, a.Z * b.X - a.X * b.Z, a.X * b.Y - a.Y * b.X));
 }
Esempio n. 3
0
 public JVector3 Translate(JVector3 trans)
 {
     return(new JVector3(X + trans.X, Y + trans.Y, Z + trans.Z));
 }
Esempio n. 4
0
 public static double Dot(JVector3 a, JVector3 b)
 {
     return(a.X * b.X + a.Y * b.Y + a.Z * b.Z);
 }