public AddSurface ( SurfaceFunc func, double zFarthest, double zClosest ) : void | ||
func | SurfaceFunc | |
zFarthest | double | determines bounds of the grid (grid must coincide with visible region) |
zClosest | double | determines base grid cell size |
return | void |
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); }
private static void CreateSurface() { var asb = new AutoStereogramBuilder(1024, 768, 3); asb.AddSurface((x, y) => 2 + Math.Sin(Math.Sqrt(x * x + y * y) * 40 + Math.Atan2(y, x)) * 0.25 / (4 * Math.Sqrt(x * x + y * y) + 1), 2.25, 1.75); asb.GenerateBitmap().Save(GetPathAtAssemblyLocation("output\\surface.gif"), ImageFormat.Gif); }