Beispiel #1
0
        public Ray3D GetMouseRay(ICameraInfo cameraInfo, Point3D mouseWorld)
        {
            var mouseRay0 = Projection0.GetMouseRay(cameraInfo, mouseWorld);
            var mouseRay1 = Projection1.GetMouseRay(cameraInfo, mouseWorld);

            var plane      = new Plane(cameraInfo.Position, (cameraInfo.Target - cameraInfo.Position).Normalize());
            var rayOrigin0 = plane.IntersectionWith(mouseRay0);
            var rayOrigin1 = plane.IntersectionWith(mouseRay1);

            var rayOriginCombined    = rayOrigin0.InterpolateLinear(rayOrigin1, Weight1);
            var rayDirectionCombined = mouseRay0.Direction.InterpolateLinear(mouseRay1.Direction, Weight1);

            return(new Ray3D(rayOriginCombined, rayDirectionCombined));
        }
Beispiel #2
0
 public IProjection GetAdjustedProjection(double aspectRatio)
 {
     return(new ProjectionCombined(Projection0.GetAdjustedProjection(aspectRatio), Projection1.GetAdjustedProjection(aspectRatio), Weight0));
 }
Beispiel #3
0
 public Matrix4D GetMatrixProjection()
 {
     return(Projection0.GetMatrixProjection().InterpolateLinear(Projection1.GetMatrixProjection(), Weight1));
 }