AutoStereogramDemo.AutoStereogramBuilder.AddSphere C# (CSharp) Method

AddSphere() public method

public AddSphere ( double xCenter, double yCenter, double zCenter, double radius ) : void
xCenter double
yCenter double
zCenter double
radius double
return void
        public void AddSphere(double xCenter, double yCenter, double zCenter, double radius)
        {
            AddRayTracedObject(xCenter - radius, xCenter + radius, yCenter - radius, yCenter + radius, zCenter - radius, zCenter + radius,
             (int xProj, int yProj, double eyeXPos, out double x, out double z) =>
             GetSphereRayIntersection(xCenter, yCenter, zCenter, radius, xProj, yProj, eyeXPos, out x, out z));
        }

Usage Example

Example #1
0
        private static void CreateWavesWithImage()
        {
            var asb = new AutoStereogramBuilder(1024, 768, 3);

            asb.AddSphere(-0.2, -0.2, 1.6, 0.025);
            asb.AddSphere(-0.2, -0.2, 1.4, 0.025);
            asb.AddSurface(WavesSurfaceFunc, 2.3, 1.7);

            Bitmap bitmap = (Bitmap)Image.FromFile(GetPathAtAssemblyLocation("input\\hi.png"));

            asb.AddModelByDepthMap(bitmap, new Point3D {
                X = 0.1, Y = -0.3, Z = 1.8
            }, new Vector3D {
                X = 1, Y = 0.5, Z = -1
            },
                                   new Vector3D {
                X = -0.5, Y = 1, Z = -1
            }, new Vector3D {
                X = 1, Y = 1, Z = 1
            }, 0.8, 0.8, 0.05);

            Bitmap backgroundImage = (Bitmap)Image.FromFile(GetPathAtAssemblyLocation("input\\background.jpg"));

            asb.GenerateBitmap(backgroundImage).Save(GetPathAtAssemblyLocation("output\\hello.jpg"), ImageFormat.Jpeg);
        }
All Usage Examples Of AutoStereogramDemo.AutoStereogramBuilder::AddSphere