Example #1
0
        protected void MoveObserverToTransformation(HomogeneousPoint3D point, IPolyhedron3D obj)
        {
            Matrix affineMatrix = AffineTransformation.MoveOriginTo(point);

            obj.Transform(affineMatrix);
            obj.TransformRotationCenter(affineMatrix);
        }
Example #2
0
        private static void MovePolyhedronGeometricCenter(HomogeneousPoint3D currentCenter,
                                                          HomogeneousPoint3D needCenter, IPolyhedron3D polyhedron)
        {
            var originPoint = new HomogeneousPoint3D(
                currentCenter.X - needCenter.X,
                currentCenter.Y - needCenter.Y,
                currentCenter.Z - needCenter.Z,
                needCenter.W);
            Matrix affineMatrix = AffineTransformation.MoveOriginTo(originPoint);

            polyhedron.Transform(affineMatrix);
        }
Example #3
0
        protected void RotateAroundVectorTransformation(double angle, IPolyhedron3D obj)
        {
            Matrix affineMatrix = AffineTransformation.RotateAroundVector(obj.RotationVector, angle);

            obj.Transform(affineMatrix);
        }
Example #4
0
        protected void RotateAroundAxisTransformation(Axis3D axis, double angle, IPolyhedron3D obj)
        {
            Matrix affineMatrix = AffineTransformation.RotateAroundAxisAtPoint(axis, obj.RotationCenter, angle);

            obj.Transform(affineMatrix);
        }