public CoordSystem(JVertex3D pos, JVertex3D scale) { Position = pos; Rotation = new JQuaternion3D(); Scale = scale; /* * XAxis = new JRigidBody3D(new JVertex3D[2] { new JVertex3D(0, 0, 0, 1), new JVertex3D(1, 0, 0, 1) }, * new JLine3D[1] { new JLine3D(new JVertex3D(0, 0, 0, 1), new JVertex3D(1, 0, 0, 1)) }, * new JVertex3D(0, 0, 0, 1), * new JQuaternion3D(), * new JVertex3D(1, 1, 1, 0), * new Color(1, 0, 0)); * * YAxis = new JRigidBody3D(new JVertex3D[2] { new JVertex3D(0, 0, 0, 1), new JVertex3D(0, 1, 0, 1) }, * new JLine3D[1] { new JLine3D(new JVertex3D(0, 0, 0, 1), new JVertex3D(0, 1, 0, 1)) }, * new JVertex3D(0, 0, 0, 1), * new JQuaternion3D(), * new JVertex3D(1, 1, 1, 0), * new Color(0, 1, 0)); * * ZAxis = new JRigidBody3D(new JVertex3D[2] { new JVertex3D(0, 0, 0, 1), new JVertex3D(0, 0, 1, 1) }, * new JLine3D[1] { new JLine3D(new JVertex3D(0, 0, 0, 1), new JVertex3D(0, 0, 1, 1)) }, * new JVertex3D(0, 0, 0, 1), * new JQuaternion3D(), * new JVertex3D(1, 1, 1, 0), * new Color(0, 0, 1)); * * RigidBodies = new JRigidBody3D[3] { XAxis, YAxis, ZAxis };*/ }
public Vector GetImagePoint(JVertex3D v) { Vector p; p.X = 160.0 * v.X + 160.0; p.Y = -100.0 * v.Y + 100.0; return(p); }
public JBody3D ToJBody3D() { JBody3D body = new JBody3D(); body.Position = Position; body.Rotation = Rotation; body.Scale = Scale; Scale = new JVertex3D(1, 1, 1, 0); Position = new JVertex3D(0, 0, 0, 1); Rotation = new JQuaternion3D(1, 0, 0, 0); body.RigidBodies = new JRigidBody3D[1] { this }; return(body); }
public JTranslationMatrix3D(JVertex3D translation) : base() { Elements[0, 3] = translation.X; Elements[1, 3] = translation.Y; Elements[2, 3] = translation.Z; }
public void CenterToPoint(JVertex3D pos) { Direction = new JVertex3D(pos.X - Direction.X, pos.Y - Direction.Y, pos.Z - Direction.Z, 0).Normalized; Rotation = new JQuaternion3D(new JVertex3D(0, 0, 1, 0), Direction); }
public JCamera(JVertex3D pos, JVertex3D dir) { Position = pos; Direction = dir.Normalized; Rotation = new JQuaternion3D(new JVertex3D(0, 0, 1, 0), dir); }
public JScaleMatrix3D(JVertex3D scale) : base() { Elements[0, 0] = scale.X; Elements[1, 1] = scale.Y; Elements[2, 2] = scale.Z; }