Ejemplo 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);
        }
Ejemplo 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));
 }
Ejemplo n.º 3
0
 public JVector3 Translate(JVector3 trans)
 {
     return(new JVector3(X + trans.X, Y + trans.Y, Z + trans.Z));
 }
Ejemplo n.º 4
0
 public static double Dot(JVector3 a, JVector3 b)
 {
     return(a.X * b.X + a.Y * b.Y + a.Z * b.Z);
 }