Ejemplo n.º 1
0
        public void Render(WireFrameRenderer renderer)
        {
            Matrix4x4 translateMatrix = Matrix4x4.CreateTranslateMatrix(Position + PositionBias);

            foreach (Triangle triangle in BulletModel.Tris)
            {
                renderer.EnqueueTriangle(new Triangle(
                                             (translateMatrix * (RotationMatrix * triangle.A.ToXYZ1())).HomogeneousToXYZ(),
                                             (translateMatrix * (RotationMatrix * triangle.B.ToXYZ1())).HomogeneousToXYZ(),
                                             (translateMatrix * (RotationMatrix * triangle.C.ToXYZ1())).HomogeneousToXYZ()
                                             ));
            }
        }
Ejemplo n.º 2
0
        public override void Render(WireFrameRenderer renderer)
        {
            Matrix4x4 translateMatrix = Matrix4x4.CreateTranslateMatrix(Position);
            Matrix4x4 rotateMatrix    = currentRotationMatrix;


            foreach (Triangle triangle in Cube.Tris)
            {
                renderer.EnqueueTriangle(new Triangle(
                                             (translateMatrix * (rotateMatrix * (sizeMatrix * triangle.A.ToXYZ1()))).HomogeneousToXYZ(),
                                             (translateMatrix * (rotateMatrix * (sizeMatrix * triangle.B.ToXYZ1()))).HomogeneousToXYZ(),
                                             (translateMatrix * (rotateMatrix * (sizeMatrix * triangle.C.ToXYZ1()))).HomogeneousToXYZ()
                                             ));
            }
        }