http://www.rulez-t.info/foto_pics/9160-beskonechnye-fotki-20-shtuk.html
кто знает как делать такое?
бесконечные фото
Всего 18 сообщ.
|
Показаны 1 - 18
бесконечные фото
Re[Юрий]:
на такие фотки долго посмотришь - крыша начинает ехать

Re[VAngeR]:
я посмотрел точно. они не бесконечные.там всё одним пикселем заканчивается ;)
Re[VAngeR]:
от: VAngeR
на такие фотки долго посмотришь - крыша начинает ехать
а как она едет у того, кто их делает...
Re[VAngeR]:
от: VAngeR
на такие фотки долго посмотришь - крыша начинает ехать
Ну какое кому дело, что и куда у кого едет - вопрос в другом, а не знаешь - не флуди!
Re[Юрий]:
Это называется эффект Эшера-Дорсте (Escher-Droste)
Помню кофе был голландский Дросте, на этикетке там стоит девушка и держит в руках пачку кофе, на этикетке которой стоит девушка и держит кофе, на этикетке которого...
Можно делать в ГИМПе с помощью плагина MathMap, если надо, могу прислать коды
Если мощная видеокарта, поддерживающая Pixel Bender, можно воспользоваться кернелом (формат pbk)
[quot]
kernel Droste
< namespace : "com.subblue.filters";
vendor : "Tom Beddard";
version : 1;
description : "The Droste effect.";
>
// Quickstart
//
// These are the steps you should follow for best results:
// 1) Set the size to match the source image
// 2) Adjust the shift so that the spiral is centered on the area you want to repeat
// 3) If the source image is a 24-bit PNG with a transparent centre section
// (like a picture frame) then set enableTransparencyInside to 1.
// If the image has a transparent outside (like a flower cut-out) set enableOutsideTransparency to 1
// 4) Adjust the inner radius in combination with tweaking the shift values until the repeated section
// aligns nicely.
// 5) Adjust the center parameter to frame the overall image.
//
// Tips
//
// Periodicity:
// This sets the number of times the image is repeat on each level of the spiral. For
// picture frame type images leave this as 1. For circular images small adjustments
// might be needed to get a nice repeating spiral but it is always worth enabling
// the setAutoPeriodicity setting.
//
// Levels:
// Increase the startLevel so that the image fills the outer area.
// Increase the numberOfLevels until the centre of the spiral has filled in.
//
// Strands:
// This sets the number of arms on the spiral. When set greater than 1 and applied to an image
// like a flower that has an outside transparency then strandMirror for seamless tiling.
//
// Poles and other mapping effects:
// When enablePoles is set then the polarCoordinates can be used.
// When tilePoles is set then enableHyperDroste setting can be applied and the fractal points
// setting will then take effect.
// The untwist option will tile the untwisted annular section effectively unrolling a circular
// image.
// Constants
#define PI 3.1415926535897932384626433832795
#define I float2(0.0, 1.0)
// Complex math operations
#define complexMult(a,b) float2(a.x*b.x - a.y*b.y, a.x*b.y + a.y*b.x)
#define complexMag(z) float(pow(length(z), 2.0))
#define complexReciprocal(z) float2(z.x / complexMag(z), -z.y / complexMag(z))
#define complexDivision(a,b) complexMult(a, complexReciprocal(b))
#define complexArg(z) float(atan(z.y, z.x))
#define complexLog(z) float2(log(length(z)), complexArg(z))
#define complexExp(z) float2(exp(z.x) * cos(z.y), exp(z.x) * sin(z.y))
#define sinh(x) float((exp(x) - exp(-x)) / 2.0)
#define cosh(x) float((exp(x) + exp(-x)) / 2.0)
#define complexSin(z) float2(sin(z.x) * cosh(z.y), cos(z.x) * sinh(z.y))
#define complexCos(z) float2(cos(z.x) * cosh(z.y), -sin(z.x) * sinh(z.y))
#define complexTan(z) float2(sin(2.0 * z.x)/(cos(2.0 * z.x) + cosh(2.0 * z.y)), sinh(2.0 * z.y)/(cos(2.0 * z.x) + cosh(2.0 * z.y)))
#define complexSinh(z) float2(sinh(z.x) * cos(z.y), cosh(z.x) * sin(z.y))
#define complexCosh(z) float2(cosh(z.x) * cos(z.y), sinh(z.x) * sin(z.y))
#define complexTanh(z) float2(sinh(2.0 * z.x)/(cosh(2.0 * z.a) + cos(2.0 * z.y)), sin(2.0 * z.y)/(cosh(2.0 * z.x) + cos(2.0 * z.y)))
#define polar(r,a) float2(cos(a) * r, sin(a) * r)
#define power(z,p) float2(polar(pow(length(z), float(p)), float(p) * complexArg(z)))
{
input image4 src;
output pixel4 dst;
parameter int2 size
<
minValue:int2(100, 100);
maxValue:int2(4000, 4000);
defaultValue:int2(600, 600);
description: "Set to match source image size";
>;
parameter float innerRadius
<
minValue:0.1;
maxValue:100.0;
defaultValue:25.0;
description: "The inner radius of the repeating annular";
>;
parameter float outerRadius
<
minValue:1.0;
maxValue:100.0;
defaultValue:100.0;
description: "The outer radius of the repeating annular";
>;
parameter float periodicity
<
minValue:-6.0;
maxValue: 6.0;
defaultValue:1.0;
description: "The number of image the image is repeated on each level";
>;
parameter float strands
<
minValue:-6.0;
maxValue: 6.0;
defaultValue:1.0;
description: "The number of strands of the spiral";
>;
parameter int strandMirror
<
minValue:0;
maxValue:1;
defaultValue:0;
description: "Activate for smoother repeating when using more than one strand";
>;
parameter float zoom
<
minValue:0.0;
maxValue:30.0;
defaultValue:0.0;
description: "Overall image magnification";
>;
parameter float rotate
<
minValue:-360.0;
maxValue: 360.0;
defaultValue:0.0;
description: "Overall image rotation";
>;
parameter float2 center
<
minValue:float2(-200.0, -200.0);
maxValue:float2(200.0, 200.0);
defaultValue:float2(0.0, 0.0);
description: "Panning of the image in the output frame";
>;
parameter float2 centerShift
<
minValue:float2(-200.0, -200.0);
maxValue:float2(200.0, 200.0);
defaultValue:float2(0.0, 0.0);
description: "Shift the centre of the spiral";
>;
parameter int numberOfLevels
<
minValue:1;
maxValue:20;
defaultValue:9;
description: "The number of repeating levels of the spiral";
>;
parameter int startLevel
<
minValue:1;
maxValue:20;
defaultValue:3;
description: "The starting spiral level";
>;
parameter int enableTransparencyInside
<
minValue:0;
maxValue:1;
defaultValue:0;
description: "Enable for images with transparent middle areas (such as a picture frame).";
>;
parameter int enableTransparencyOutside
<
minValue:0;
maxValue:1;
defaultValue:0;
description: "Enable for images with transparent areas around the outside.";
>;
parameter int untwist
<
minValue:0;
maxValue:1;
defaultValue:0;
description: "Unroll the circular annular of the image.";
>;
parameter int setAutoPeriodicity
<
minValue:0;
maxValue:1;
defaultValue:0;
description: "Automatically set the ideal periodicity for the current radius settings.";
>;
parameter float3 polarCoordinates
<
minValue: float3(-180, -100, -100);
maxValue: float3(180, 100, 100);
defaultValue: float3(90, 0, 0);
description: "Polar rotation, latitude and longitude";
>;
parameter int enablePoles
<
minValue:0;
maxValue:1;
defaultValue:0;
description: "Show both poles";
>;
parameter int enableHyperDroste
<
minValue:0;
maxValue:1;
defaultValue:0;
description: "Enable hyper droste effect. Applies when enablePoles active.";
>;
parameter int tilePoles
<
minValue:0;
maxValue:1;
defaultValue:0;
description: "Enable for hyper droste option.";
>;
parameter int fractalPoints
<
minValue:1;
maxValue:10;
defaultValue:1;
description: "Used by hyper droste option.";
>;
dependent float r1, r2, p1, p2, w, h, alphaThreshold;
dependent float2 _shift, _center, _rotate, _zoom, xBounds, yBounds, xyMiddle, minDimension;
dependent bool showPoles, hyperDroste, tileBasedOnTransparency, transparentPointsIn, twist;
// Initialize parameters
void evaluateDependents()
{
// Set code variables
r1 = innerRadius / 100.0;
r2 = outerRadius / 100.0;
p1 = periodicity;
if (p1 == 0.0) p1 = 0.001; // Prevent divide by zero
p2 = strands;
transparentPointsIn = enableTransparencyOutside == 0 ? true : false;
tileBasedOnTransparency = (enableTransparencyInside == 1 || !transparentPointsIn) ? true : false;
twist = untwist == 0 ? true : false;
alphaThreshold = 0.01;
_shift = 1.0 + centerShift / 100.0;
_center = (float2(size) / 2.0) + center * (float2(size) / 2.0) / 100.0;
w = float(size.x);
h = float(size.y);
minDimension = float2(min(w, h) / 2.0);
// Autoset periodicity
if (setAutoPeriodicity == 1) {
p1 = p2/2.0 * (1.0 + sqrt(1.0 - pow(log(r2/r1)/PI, 2.0)));
}
// Set rotation
_rotate = p1 > 0.0 ? float2(-(PI/180.0) * rotate, 0.0) : float2((PI/180.0) * rotate, 0.0);
// Set zoom
_zoom = float2((exp(zoom) + innerRadius - 1.0) / 100.0, 0.0);
// Scale viewport pixels to complex plane
if (twist) {
xBounds = float2(-r2, r2);
yBounds = float2(-r2, r2);
} else {
xBounds = float2(-log(r2/r1), log(r2/r1));
yBounds = float2(0.0, 2.1 * PI);
}
xyMiddle = float2((xBounds.x + xBounds.y) / 2.0, (yBounds.x + yBounds.y) / 2.0);
float2 xyRange = float2(xBounds.y - xBounds.x, yBounds.y - yBounds.x);
xyRange.x = xyRange.y * (w / h);
xBounds = float2(xyMiddle.x - xyRange.x/2.0, xyMiddle.x + xyRange.x/2.0);
// Polar options
showPoles = enablePoles == 1 ? true : false;
hyperDroste = enableHyperDroste == 1 ? true : false;
}
void renderPixel(
in float2 z,
inout float alphaRemaining,
inout int sign,
inout int iteration,
inout pixel4 colorSoFar
)
{
float2 d = minDimension * (z + _shift);
sign = 0;
if (tileBasedOnTransparency || iteration == 0) {
dst = sample(src, d);
colorSoFar += dst * (dst.a * alphaRemaining);
alphaRemaining *= (1.0 - dst.a);
}
if (tileBasedOnTransparency) {
if ( transparentPointsIn && alphaRemaining > alphaThreshold) sign = -1;
if (!transparentPointsIn && alphaRemaining > alphaThreshold) sign = 1;
} else {
if (iteration > 0) colorSoFar = sample(src, d);
float radius = length(z);
sign = (radius < r1) ? -1 : (radius > r2 ? 1 : 0);
}
iteration += 1;
}
void evaluatePixel()
{
float2 s = outCoord();
float2 z, d, ratio, polar;
float radius, theta, div;
int iteration;
int sign = 0;
float alphaRemaining = 1.0;
z = float2((xBounds.x + (xBounds.y - xBounds.x) * ((s.x - _center.x) + w / 2.0) / w),
(yBounds.x + (yBounds.y - yBounds.x) * ((s.y - _center.y) + h / 2.0) / h));
// Only allow for procedural zooming/scaling in the standard coordinates
if (twist) {
z = xyMiddle + complexMult(complexDivision((z - xyMiddle), _zoom), complexExp(complexMult(-I, _rotate)));
}
// Extra options
polar = (float2(polarCoordinates.y, polarCoordinates.z) * w / s.x) / 100.0;
if (showPoles) {
theta = (PI/180.0) * polarCoordinates.x;
div = (1.0 + pow(z.x, 2.0) + pow(z.y, 2.0) + ((1.0 - pow(z.x, 2.0) - pow(z.y, 2.0)) * cos(theta)) - (2.0 * z.x * sin(theta))) / 2.0;
z.x = z.x * cos(theta) + ((1.0 - pow(z.x, 2.0) - pow(z.y, 2.0)) * sin(theta) / 2.0);
z = complexDivision(z, float2(div, 0.0));
} else {
if (hyperDroste) {
z = complexSin(z);
}
if (tilePoles == 1) {
z = power(z, fractalPoints);
z = complexTan(complexMult(z, float2(2.0, 0.0)));
}
}
z += polar;
if (twist) {
z = complexLog(complexDivision(z, float2(r1, 0.0)));
}
// Start Droste-effect code
float2 alpha = float2(atan((p2/p1) * (log(r2/r1) / (2.0*PI))), 0.0);
float2 f = float2(cos(alpha.x), 0.0);
float2 beta = complexMult(f, complexExp(complexMult(alpha, I)));
// The angle of rotation between adjacent annular levels
float2 angle = float2(-2.0 * PI * p1, 0.0);
if (p2 > 0.0) angle = -angle;
if (strandMirror == 1) angle /= strands;
z = complexDivision(complexMult(float2(p1, 0.0), z), beta);
z = complexMult(float2(r1, 0.0), complexExp(z));
// End Droste-effect code
// Start drawing
if (tileBasedOnTransparency && startLevel > 0) {
if (!transparentPointsIn) ratio = complexMult(float2(r2/r1, 0.0), complexExp(complexMult(angle, I)));
if ( transparentPointsIn) ratio = complexMult(float2(r1/r2, 0.0), complexExp(complexMult(angle,-I)));
z = complexMult(z, power(ratio, startLevel));
}
pixel4 colorSoFar = pixel4(0.0, 0.0, 0.0, 0.0);
iteration = 0;
renderPixel(z, alphaRemaining, sign, iteration, colorSoFar);
if (sign < 0) ratio = complexMult(float2(r2/r1, 0.0), complexExp(complexMult(angle, I)));
if (sign > 0) ratio = complexMult(float2(r1/r2, 0.0), complexExp(complexMult(angle, -I)));
iteration = startLevel;
int maxIteration = numberOfLevels + startLevel - 1;
while (sign != 0 && iteration < maxIteration) {
z = complexMult(z, ratio);
renderPixel(z, alphaRemaining, sign, iteration, colorSoFar);
}
dst = colorSoFar;
}
}
[/quot]
Помню кофе был голландский Дросте, на этикетке там стоит девушка и держит в руках пачку кофе, на этикетке которой стоит девушка и держит кофе, на этикетке которого...
Можно делать в ГИМПе с помощью плагина MathMap, если надо, могу прислать коды
Если мощная видеокарта, поддерживающая Pixel Bender, можно воспользоваться кернелом (формат pbk)
[quot]
kernel Droste
< namespace : "com.subblue.filters";
vendor : "Tom Beddard";
version : 1;
description : "The Droste effect.";
>
// Quickstart
//
// These are the steps you should follow for best results:
// 1) Set the size to match the source image
// 2) Adjust the shift so that the spiral is centered on the area you want to repeat
// 3) If the source image is a 24-bit PNG with a transparent centre section
// (like a picture frame) then set enableTransparencyInside to 1.
// If the image has a transparent outside (like a flower cut-out) set enableOutsideTransparency to 1
// 4) Adjust the inner radius in combination with tweaking the shift values until the repeated section
// aligns nicely.
// 5) Adjust the center parameter to frame the overall image.
//
// Tips
//
// Periodicity:
// This sets the number of times the image is repeat on each level of the spiral. For
// picture frame type images leave this as 1. For circular images small adjustments
// might be needed to get a nice repeating spiral but it is always worth enabling
// the setAutoPeriodicity setting.
//
// Levels:
// Increase the startLevel so that the image fills the outer area.
// Increase the numberOfLevels until the centre of the spiral has filled in.
//
// Strands:
// This sets the number of arms on the spiral. When set greater than 1 and applied to an image
// like a flower that has an outside transparency then strandMirror for seamless tiling.
//
// Poles and other mapping effects:
// When enablePoles is set then the polarCoordinates can be used.
// When tilePoles is set then enableHyperDroste setting can be applied and the fractal points
// setting will then take effect.
// The untwist option will tile the untwisted annular section effectively unrolling a circular
// image.
// Constants
#define PI 3.1415926535897932384626433832795
#define I float2(0.0, 1.0)
// Complex math operations
#define complexMult(a,b) float2(a.x*b.x - a.y*b.y, a.x*b.y + a.y*b.x)
#define complexMag(z) float(pow(length(z), 2.0))
#define complexReciprocal(z) float2(z.x / complexMag(z), -z.y / complexMag(z))
#define complexDivision(a,b) complexMult(a, complexReciprocal(b))
#define complexArg(z) float(atan(z.y, z.x))
#define complexLog(z) float2(log(length(z)), complexArg(z))
#define complexExp(z) float2(exp(z.x) * cos(z.y), exp(z.x) * sin(z.y))
#define sinh(x) float((exp(x) - exp(-x)) / 2.0)
#define cosh(x) float((exp(x) + exp(-x)) / 2.0)
#define complexSin(z) float2(sin(z.x) * cosh(z.y), cos(z.x) * sinh(z.y))
#define complexCos(z) float2(cos(z.x) * cosh(z.y), -sin(z.x) * sinh(z.y))
#define complexTan(z) float2(sin(2.0 * z.x)/(cos(2.0 * z.x) + cosh(2.0 * z.y)), sinh(2.0 * z.y)/(cos(2.0 * z.x) + cosh(2.0 * z.y)))
#define complexSinh(z) float2(sinh(z.x) * cos(z.y), cosh(z.x) * sin(z.y))
#define complexCosh(z) float2(cosh(z.x) * cos(z.y), sinh(z.x) * sin(z.y))
#define complexTanh(z) float2(sinh(2.0 * z.x)/(cosh(2.0 * z.a) + cos(2.0 * z.y)), sin(2.0 * z.y)/(cosh(2.0 * z.x) + cos(2.0 * z.y)))
#define polar(r,a) float2(cos(a) * r, sin(a) * r)
#define power(z,p) float2(polar(pow(length(z), float(p)), float(p) * complexArg(z)))
{
input image4 src;
output pixel4 dst;
parameter int2 size
<
minValue:int2(100, 100);
maxValue:int2(4000, 4000);
defaultValue:int2(600, 600);
description: "Set to match source image size";
>;
parameter float innerRadius
<
minValue:0.1;
maxValue:100.0;
defaultValue:25.0;
description: "The inner radius of the repeating annular";
>;
parameter float outerRadius
<
minValue:1.0;
maxValue:100.0;
defaultValue:100.0;
description: "The outer radius of the repeating annular";
>;
parameter float periodicity
<
minValue:-6.0;
maxValue: 6.0;
defaultValue:1.0;
description: "The number of image the image is repeated on each level";
>;
parameter float strands
<
minValue:-6.0;
maxValue: 6.0;
defaultValue:1.0;
description: "The number of strands of the spiral";
>;
parameter int strandMirror
<
minValue:0;
maxValue:1;
defaultValue:0;
description: "Activate for smoother repeating when using more than one strand";
>;
parameter float zoom
<
minValue:0.0;
maxValue:30.0;
defaultValue:0.0;
description: "Overall image magnification";
>;
parameter float rotate
<
minValue:-360.0;
maxValue: 360.0;
defaultValue:0.0;
description: "Overall image rotation";
>;
parameter float2 center
<
minValue:float2(-200.0, -200.0);
maxValue:float2(200.0, 200.0);
defaultValue:float2(0.0, 0.0);
description: "Panning of the image in the output frame";
>;
parameter float2 centerShift
<
minValue:float2(-200.0, -200.0);
maxValue:float2(200.0, 200.0);
defaultValue:float2(0.0, 0.0);
description: "Shift the centre of the spiral";
>;
parameter int numberOfLevels
<
minValue:1;
maxValue:20;
defaultValue:9;
description: "The number of repeating levels of the spiral";
>;
parameter int startLevel
<
minValue:1;
maxValue:20;
defaultValue:3;
description: "The starting spiral level";
>;
parameter int enableTransparencyInside
<
minValue:0;
maxValue:1;
defaultValue:0;
description: "Enable for images with transparent middle areas (such as a picture frame).";
>;
parameter int enableTransparencyOutside
<
minValue:0;
maxValue:1;
defaultValue:0;
description: "Enable for images with transparent areas around the outside.";
>;
parameter int untwist
<
minValue:0;
maxValue:1;
defaultValue:0;
description: "Unroll the circular annular of the image.";
>;
parameter int setAutoPeriodicity
<
minValue:0;
maxValue:1;
defaultValue:0;
description: "Automatically set the ideal periodicity for the current radius settings.";
>;
parameter float3 polarCoordinates
<
minValue: float3(-180, -100, -100);
maxValue: float3(180, 100, 100);
defaultValue: float3(90, 0, 0);
description: "Polar rotation, latitude and longitude";
>;
parameter int enablePoles
<
minValue:0;
maxValue:1;
defaultValue:0;
description: "Show both poles";
>;
parameter int enableHyperDroste
<
minValue:0;
maxValue:1;
defaultValue:0;
description: "Enable hyper droste effect. Applies when enablePoles active.";
>;
parameter int tilePoles
<
minValue:0;
maxValue:1;
defaultValue:0;
description: "Enable for hyper droste option.";
>;
parameter int fractalPoints
<
minValue:1;
maxValue:10;
defaultValue:1;
description: "Used by hyper droste option.";
>;
dependent float r1, r2, p1, p2, w, h, alphaThreshold;
dependent float2 _shift, _center, _rotate, _zoom, xBounds, yBounds, xyMiddle, minDimension;
dependent bool showPoles, hyperDroste, tileBasedOnTransparency, transparentPointsIn, twist;
// Initialize parameters
void evaluateDependents()
{
// Set code variables
r1 = innerRadius / 100.0;
r2 = outerRadius / 100.0;
p1 = periodicity;
if (p1 == 0.0) p1 = 0.001; // Prevent divide by zero
p2 = strands;
transparentPointsIn = enableTransparencyOutside == 0 ? true : false;
tileBasedOnTransparency = (enableTransparencyInside == 1 || !transparentPointsIn) ? true : false;
twist = untwist == 0 ? true : false;
alphaThreshold = 0.01;
_shift = 1.0 + centerShift / 100.0;
_center = (float2(size) / 2.0) + center * (float2(size) / 2.0) / 100.0;
w = float(size.x);
h = float(size.y);
minDimension = float2(min(w, h) / 2.0);
// Autoset periodicity
if (setAutoPeriodicity == 1) {
p1 = p2/2.0 * (1.0 + sqrt(1.0 - pow(log(r2/r1)/PI, 2.0)));
}
// Set rotation
_rotate = p1 > 0.0 ? float2(-(PI/180.0) * rotate, 0.0) : float2((PI/180.0) * rotate, 0.0);
// Set zoom
_zoom = float2((exp(zoom) + innerRadius - 1.0) / 100.0, 0.0);
// Scale viewport pixels to complex plane
if (twist) {
xBounds = float2(-r2, r2);
yBounds = float2(-r2, r2);
} else {
xBounds = float2(-log(r2/r1), log(r2/r1));
yBounds = float2(0.0, 2.1 * PI);
}
xyMiddle = float2((xBounds.x + xBounds.y) / 2.0, (yBounds.x + yBounds.y) / 2.0);
float2 xyRange = float2(xBounds.y - xBounds.x, yBounds.y - yBounds.x);
xyRange.x = xyRange.y * (w / h);
xBounds = float2(xyMiddle.x - xyRange.x/2.0, xyMiddle.x + xyRange.x/2.0);
// Polar options
showPoles = enablePoles == 1 ? true : false;
hyperDroste = enableHyperDroste == 1 ? true : false;
}
void renderPixel(
in float2 z,
inout float alphaRemaining,
inout int sign,
inout int iteration,
inout pixel4 colorSoFar
)
{
float2 d = minDimension * (z + _shift);
sign = 0;
if (tileBasedOnTransparency || iteration == 0) {
dst = sample(src, d);
colorSoFar += dst * (dst.a * alphaRemaining);
alphaRemaining *= (1.0 - dst.a);
}
if (tileBasedOnTransparency) {
if ( transparentPointsIn && alphaRemaining > alphaThreshold) sign = -1;
if (!transparentPointsIn && alphaRemaining > alphaThreshold) sign = 1;
} else {
if (iteration > 0) colorSoFar = sample(src, d);
float radius = length(z);
sign = (radius < r1) ? -1 : (radius > r2 ? 1 : 0);
}
iteration += 1;
}
void evaluatePixel()
{
float2 s = outCoord();
float2 z, d, ratio, polar;
float radius, theta, div;
int iteration;
int sign = 0;
float alphaRemaining = 1.0;
z = float2((xBounds.x + (xBounds.y - xBounds.x) * ((s.x - _center.x) + w / 2.0) / w),
(yBounds.x + (yBounds.y - yBounds.x) * ((s.y - _center.y) + h / 2.0) / h));
// Only allow for procedural zooming/scaling in the standard coordinates
if (twist) {
z = xyMiddle + complexMult(complexDivision((z - xyMiddle), _zoom), complexExp(complexMult(-I, _rotate)));
}
// Extra options
polar = (float2(polarCoordinates.y, polarCoordinates.z) * w / s.x) / 100.0;
if (showPoles) {
theta = (PI/180.0) * polarCoordinates.x;
div = (1.0 + pow(z.x, 2.0) + pow(z.y, 2.0) + ((1.0 - pow(z.x, 2.0) - pow(z.y, 2.0)) * cos(theta)) - (2.0 * z.x * sin(theta))) / 2.0;
z.x = z.x * cos(theta) + ((1.0 - pow(z.x, 2.0) - pow(z.y, 2.0)) * sin(theta) / 2.0);
z = complexDivision(z, float2(div, 0.0));
} else {
if (hyperDroste) {
z = complexSin(z);
}
if (tilePoles == 1) {
z = power(z, fractalPoints);
z = complexTan(complexMult(z, float2(2.0, 0.0)));
}
}
z += polar;
if (twist) {
z = complexLog(complexDivision(z, float2(r1, 0.0)));
}
// Start Droste-effect code
float2 alpha = float2(atan((p2/p1) * (log(r2/r1) / (2.0*PI))), 0.0);
float2 f = float2(cos(alpha.x), 0.0);
float2 beta = complexMult(f, complexExp(complexMult(alpha, I)));
// The angle of rotation between adjacent annular levels
float2 angle = float2(-2.0 * PI * p1, 0.0);
if (p2 > 0.0) angle = -angle;
if (strandMirror == 1) angle /= strands;
z = complexDivision(complexMult(float2(p1, 0.0), z), beta);
z = complexMult(float2(r1, 0.0), complexExp(z));
// End Droste-effect code
// Start drawing
if (tileBasedOnTransparency && startLevel > 0) {
if (!transparentPointsIn) ratio = complexMult(float2(r2/r1, 0.0), complexExp(complexMult(angle, I)));
if ( transparentPointsIn) ratio = complexMult(float2(r1/r2, 0.0), complexExp(complexMult(angle,-I)));
z = complexMult(z, power(ratio, startLevel));
}
pixel4 colorSoFar = pixel4(0.0, 0.0, 0.0, 0.0);
iteration = 0;
renderPixel(z, alphaRemaining, sign, iteration, colorSoFar);
if (sign < 0) ratio = complexMult(float2(r2/r1, 0.0), complexExp(complexMult(angle, I)));
if (sign > 0) ratio = complexMult(float2(r1/r2, 0.0), complexExp(complexMult(angle, -I)));
iteration = startLevel;
int maxIteration = numberOfLevels + startLevel - 1;
while (sign != 0 && iteration < maxIteration) {
z = complexMult(z, ratio);
renderPixel(z, alphaRemaining, sign, iteration, colorSoFar);
}
dst = colorSoFar;
}
}
[/quot]
Re[Brandon]:
Я в прошлом году экспериментировал с квадратурой яйца :D


Re[Brandon]:
Собственно, эксперимент №2
Хотел понять, как это делается, неделю потратил на освоение техники
Далеко не шедевр, просто ещё одна попытка
Времени не было довести технику до совершенства, может ещё вернусь

Хотел понять, как это делается, неделю потратил на освоение техники
Далеко не шедевр, просто ещё одна попытка
Времени не было довести технику до совершенства, может ещё вернусь

Re[Brandon]:
Это код для плагина MathMap к ГИМПу, если пошла такая пляска
[quot]########################################
## Droste Effect code for Mathmap ##
## Original Code by Breic (Ben) ##
## Adapted by Pisco Bandito (Josh) ##
## Version 4.0 ##
## This version for Windows and Linux ##
########################################
#You may need to alter the values of the following 9 variables to suit your image.
r1=.4; # r1 is the inner radius. r1 is greater than zero and less than r2
r2=1; # r2 is the outer radius. r2 is greater than r1 and less than 1
p1=1; # periodicity - the number of times the image will repeat per cycle
p2=1; # number of strands - the number of "arms" the spiral will have
# procedural scaling and rotation
zoom=.1; #Between .1 and 10
rotate=-30; #Between -360 and 360
# Procedural Shifting
xShift=.2; #Between -1 and 1
yShift=0; #Between -1 and 1
##
# To avoid framing problems on the largest annulus when tiling based on transparency, look
# outside (levelsToLookOut) levels to see if something farther out should cover up this pixel
# Try setting to 0 to see framing errors; 1 should be sufficient unless you have three or more
# image layers contributing to some pixel (in which case set it to 2 or more). Larger values
# slow the code down, and may lead to floating point errors.
##
levelsToLookOut=3;
############################################################
############################################################
## You should not have to change anything below this line ##
############################################################
############################################################
imageX=W; # image size, in pixels
imageY=H;
minDimension=min(imageX, imageY);
## User Variables, set these on the User Settings Tab ##
retwist=user_bool("Do Not Retwist (Leave Unchecked for Droste Effect)");
retwist=!retwist;
##
# Tiling can be based on transparency (if the input image is a tiff), or simply based on the
# radius. Using transparency, there can be protrusions between different annular layers.
# Tiling based on transparency, you can decide whether you want to look inward or
# outward from a transparent pixel. For example, with a frame you'll want to look inward,
# while for a flower you'll want to look outward.
##
tileBasedOnTransparency=user_bool("Tile Based on Transparency?");
transparentPointsIn=user_bool("Transparency Points In?");
# Miscellaneous variables
true=1;
false=0;
epsilon=.01;
##Correct the Rotation Variable
rotate=pi/180*rotate;
##
# Droste-effect code starts here
# Set Droste effect parameters
##
alpha=atan(p2/p1*log(r2/r1)/(2*pi));
f=cos(alpha);
beta=f*exp(I*alpha);
# the angle of rotation between adjacent annular levels
if (p2 > 0)
then angle = 2*pi*p1;
else
angle =-2*pi*p1;
end;
##
# Code to set up the viewport properly
##
if (retwist) then
xbounds=[-r2,r2];
ybounds=[-r2,r2];
else
ybounds=[0,2.1*pi];
xbounds=[-log(r2/r1), log(r2/r1)];
end;
xymiddle=ri:[0.5*(xbounds[0]+xbounds[1]),0.5*(ybounds[0]+ybounds[1])];
xyrange=xy:[xbounds[1]-xbounds[0], ybounds[1]-ybounds[0]];
aspectRatio=W/H;
xyrange[0]=xyrange[1]*aspectRatio;
xbounds=[xymiddle[0]-0.5*xyrange[0],xymiddle[0]+0.5*xyrange[0]];
z=ri:[(xbounds[0]+(xbounds[1]-xbounds[0])*(x+W/2)/W)+xShift,(ybounds[0]+(ybounds[1]-ybounds[0])*(y+H/2)/H)+yShift];
if (retwist) then # only allow for procedural zooming/scaling in the standard coordinates
zinitial=z;
z=xymiddle+(z-xymiddle)/zoom*exp(-I*rotate);
else
zinitial=r1*exp(z); # save these coordinates for drawing a frame later
zinitial=zinitial*zoom*exp(I*rotate);
end;
##
# The Droste effect math all takes place over the next six lines.
# All the rest of the code is for niceties.
##
if (retwist) then
z2=log(z/r1);
else
z2 = z;
end;
logz=z2; # save these coordinates for drawing a grid later
z=p1*z2/beta;
rotatedscaledlogz=z; # save these coordinates for drawing a grid later
z=r1*exp(z);
## End Droste effect math
## Tiling
if (tileBasedOnTransparency && levelsToLookOut > 0) then
if ( transparentPointsIn) then ratio=r1/r2*exp(-I*angle); end;
if (!transparentPointsIn) then ratio=r2/r1*exp( I*angle); end;
z=z*exp(levelsToLookOut*log(ratio));
end;
##
# When tiling based on transparency, color is accumulated into the colorSoFar variable,
# while alphaRemaining tells how much remains for lower layers to contribute (initially 1,
# finally 0).
##
colorSoFar=rgba:[0,0,0,0];
alphaRemaining=1;
ix=minDimension/2*z[0];
iy=minDimension/2*z[1];
color=origValXY(ix,iy);
colorSoFar = colorSoFar + (color*(alpha(color)*alphaRemaining));
alphaRemaining=alphaRemaining*(1-alpha(color));
# do we need to look inward from the current point, or outward?
sign=0;
if (tileBasedOnTransparency) then
if ( transparentPointsIn && alphaRemaining > epsilon) then sign=-1; end;
if (!transparentPointsIn && alphaRemaining > epsilon) then sign= 1; end;
else
radius=sqrt(z[0]*z[0]+z[1]*z[1]);
if (radius < r1) then sign=-1; end;
if (radius > r2) then sign= 1; end;
end;
if (sign < 0) then ratio=r2/r1*exp( I*angle); end;
if (sign > 0) then ratio=r1/r2*exp(-I*angle); end;
##
# Iteratively move inward or outward, until
# the point has radius r in [r1, r2), if tileBasedOnTransparency=false
# or until alphaRemaining=0, if tileBasedOnTransparency=true
# In the latter case, we accumulate color at each step
##
iteration=0; maxiteration=10;
while (sign != 0 && iteration < maxiteration) do
z2=z*ratio;
z=z2;
rotatedscaledlogz=rotatedscaledlogz+ri:[0,-sign*angle];
ix=minDimension/2*(z[0]);
iy=minDimension/2*(z[1]);
color=origValXY(ix,iy);
colorSoFar = colorSoFar + (color*(alpha(color)*alphaRemaining));
alphaRemaining=alphaRemaining*(1-alpha(color));
radius=sqrt(z[0]*z[0]+z[1]*z[1]);
sign=0;
if (tileBasedOnTransparency) then
if ( transparentPointsIn && alphaRemaining > epsilon) then sign=-1; end;
if (!transparentPointsIn && alphaRemaining > epsilon) then sign= 1; end;
else
radius=sqrt(z[0]*z[0]+z[1]*z[1]);
if (radius < r1) then sign=-1; end;
if (radius > r2) then sign= 1; end;
end;
iteration=iteration+1;
end;
color=colorSoFar;
color=rgba:[color[0], color[1], color[2], 1]; # set the alpha value to 1 (it could be <1 if the loop terminated at iteration maxiteration)
#This last line is important, it returns the pixel value for the current pixel
color
[/quot][/quot]
[quot]########################################
## Droste Effect code for Mathmap ##
## Original Code by Breic (Ben) ##
## Adapted by Pisco Bandito (Josh) ##
## Version 4.0 ##
## This version for Windows and Linux ##
########################################
#You may need to alter the values of the following 9 variables to suit your image.
r1=.4; # r1 is the inner radius. r1 is greater than zero and less than r2
r2=1; # r2 is the outer radius. r2 is greater than r1 and less than 1
p1=1; # periodicity - the number of times the image will repeat per cycle
p2=1; # number of strands - the number of "arms" the spiral will have
# procedural scaling and rotation
zoom=.1; #Between .1 and 10
rotate=-30; #Between -360 and 360
# Procedural Shifting
xShift=.2; #Between -1 and 1
yShift=0; #Between -1 and 1
##
# To avoid framing problems on the largest annulus when tiling based on transparency, look
# outside (levelsToLookOut) levels to see if something farther out should cover up this pixel
# Try setting to 0 to see framing errors; 1 should be sufficient unless you have three or more
# image layers contributing to some pixel (in which case set it to 2 or more). Larger values
# slow the code down, and may lead to floating point errors.
##
levelsToLookOut=3;
############################################################
############################################################
## You should not have to change anything below this line ##
############################################################
############################################################
imageX=W; # image size, in pixels
imageY=H;
minDimension=min(imageX, imageY);
## User Variables, set these on the User Settings Tab ##
retwist=user_bool("Do Not Retwist (Leave Unchecked for Droste Effect)");
retwist=!retwist;
##
# Tiling can be based on transparency (if the input image is a tiff), or simply based on the
# radius. Using transparency, there can be protrusions between different annular layers.
# Tiling based on transparency, you can decide whether you want to look inward or
# outward from a transparent pixel. For example, with a frame you'll want to look inward,
# while for a flower you'll want to look outward.
##
tileBasedOnTransparency=user_bool("Tile Based on Transparency?");
transparentPointsIn=user_bool("Transparency Points In?");
# Miscellaneous variables
true=1;
false=0;
epsilon=.01;
##Correct the Rotation Variable
rotate=pi/180*rotate;
##
# Droste-effect code starts here
# Set Droste effect parameters
##
alpha=atan(p2/p1*log(r2/r1)/(2*pi));
f=cos(alpha);
beta=f*exp(I*alpha);
# the angle of rotation between adjacent annular levels
if (p2 > 0)
then angle = 2*pi*p1;
else
angle =-2*pi*p1;
end;
##
# Code to set up the viewport properly
##
if (retwist) then
xbounds=[-r2,r2];
ybounds=[-r2,r2];
else
ybounds=[0,2.1*pi];
xbounds=[-log(r2/r1), log(r2/r1)];
end;
xymiddle=ri:[0.5*(xbounds[0]+xbounds[1]),0.5*(ybounds[0]+ybounds[1])];
xyrange=xy:[xbounds[1]-xbounds[0], ybounds[1]-ybounds[0]];
aspectRatio=W/H;
xyrange[0]=xyrange[1]*aspectRatio;
xbounds=[xymiddle[0]-0.5*xyrange[0],xymiddle[0]+0.5*xyrange[0]];
z=ri:[(xbounds[0]+(xbounds[1]-xbounds[0])*(x+W/2)/W)+xShift,(ybounds[0]+(ybounds[1]-ybounds[0])*(y+H/2)/H)+yShift];
if (retwist) then # only allow for procedural zooming/scaling in the standard coordinates
zinitial=z;
z=xymiddle+(z-xymiddle)/zoom*exp(-I*rotate);
else
zinitial=r1*exp(z); # save these coordinates for drawing a frame later
zinitial=zinitial*zoom*exp(I*rotate);
end;
##
# The Droste effect math all takes place over the next six lines.
# All the rest of the code is for niceties.
##
if (retwist) then
z2=log(z/r1);
else
z2 = z;
end;
logz=z2; # save these coordinates for drawing a grid later
z=p1*z2/beta;
rotatedscaledlogz=z; # save these coordinates for drawing a grid later
z=r1*exp(z);
## End Droste effect math
## Tiling
if (tileBasedOnTransparency && levelsToLookOut > 0) then
if ( transparentPointsIn) then ratio=r1/r2*exp(-I*angle); end;
if (!transparentPointsIn) then ratio=r2/r1*exp( I*angle); end;
z=z*exp(levelsToLookOut*log(ratio));
end;
##
# When tiling based on transparency, color is accumulated into the colorSoFar variable,
# while alphaRemaining tells how much remains for lower layers to contribute (initially 1,
# finally 0).
##
colorSoFar=rgba:[0,0,0,0];
alphaRemaining=1;
ix=minDimension/2*z[0];
iy=minDimension/2*z[1];
color=origValXY(ix,iy);
colorSoFar = colorSoFar + (color*(alpha(color)*alphaRemaining));
alphaRemaining=alphaRemaining*(1-alpha(color));
# do we need to look inward from the current point, or outward?
sign=0;
if (tileBasedOnTransparency) then
if ( transparentPointsIn && alphaRemaining > epsilon) then sign=-1; end;
if (!transparentPointsIn && alphaRemaining > epsilon) then sign= 1; end;
else
radius=sqrt(z[0]*z[0]+z[1]*z[1]);
if (radius < r1) then sign=-1; end;
if (radius > r2) then sign= 1; end;
end;
if (sign < 0) then ratio=r2/r1*exp( I*angle); end;
if (sign > 0) then ratio=r1/r2*exp(-I*angle); end;
##
# Iteratively move inward or outward, until
# the point has radius r in [r1, r2), if tileBasedOnTransparency=false
# or until alphaRemaining=0, if tileBasedOnTransparency=true
# In the latter case, we accumulate color at each step
##
iteration=0; maxiteration=10;
while (sign != 0 && iteration < maxiteration) do
z2=z*ratio;
z=z2;
rotatedscaledlogz=rotatedscaledlogz+ri:[0,-sign*angle];
ix=minDimension/2*(z[0]);
iy=minDimension/2*(z[1]);
color=origValXY(ix,iy);
colorSoFar = colorSoFar + (color*(alpha(color)*alphaRemaining));
alphaRemaining=alphaRemaining*(1-alpha(color));
radius=sqrt(z[0]*z[0]+z[1]*z[1]);
sign=0;
if (tileBasedOnTransparency) then
if ( transparentPointsIn && alphaRemaining > epsilon) then sign=-1; end;
if (!transparentPointsIn && alphaRemaining > epsilon) then sign= 1; end;
else
radius=sqrt(z[0]*z[0]+z[1]*z[1]);
if (radius < r1) then sign=-1; end;
if (radius > r2) then sign= 1; end;
end;
iteration=iteration+1;
end;
color=colorSoFar;
color=rgba:[color[0], color[1], color[2], 1]; # set the alpha value to 1 (it could be <1 if the loop terminated at iteration maxiteration)
#This last line is important, it returns the pixel value for the current pixel
color
[/quot][/quot]
Re[Brandon]:
Вот СПАСИБО, добрые люди!... :)
Теперь буду разбираться что к чему...
Теперь буду разбираться что к чему...
Re[Юрий]:

Re[Юрий]:
от: Юрийзнать бы еще, что с кодом делать...
ручками все надо делать, а не коды выворачивать, забудьте за коды плагины вам в помощь
Re[Юрий]:
в ГИМПе устанавливаешь плагин и вставляешь туда код, меняя значения
в фотошопе CS4 копируешь код в текстовый файл, меняешь расширение на pbk, и вставляешь в
_:\Program Files\Adobe\Adobe Photoshop CS4\Pixel Bender Files
Pixel Bender должен быть предварительно установлен, находится в Filters> Pixel Bender Gallery
да ещё, этот мультиплагин работает только на мощных видеокартах, перечень на сайте Adobe
в фотошопе CS4 копируешь код в текстовый файл, меняешь расширение на pbk, и вставляешь в
_:\Program Files\Adobe\Adobe Photoshop CS4\Pixel Bender Files
Pixel Bender должен быть предварительно установлен, находится в Filters> Pixel Bender Gallery
да ещё, этот мультиплагин работает только на мощных видеокартах, перечень на сайте Adobe
Re[markion]:
[quot]ручками все надо делать, а не коды выворачивать, забудьте за коды плагины вам в помощь[/quot]
ручками этого не сделаешь, так что умничать не надо
без кодов/кернелов это не прокатит
про какие плагины говоришь - поконкретней, может чего не знаю?
ручками этого не сделаешь, так что умничать не надо
без кодов/кернелов это не прокатит
про какие плагины говоришь - поконкретней, может чего не знаю?
Re[Brandon]:
от:Brandon
...
в фотошопе CS4 копируешь код в текстовый файл, меняешь расширение на pbk, и вставляешь в
_:\Program Files\Adobe\Adobe Photoshop CS4\Pixel Bender Files
Pixel Bender должен быть предварительно установлен, находится в Filters> Pixel Bender Gallery
да ещё, этот мультиплагин работает только на мощных видеокартах, перечень на сайте AdobeПодробнее
Скажите, а в CS3 это можно делать. Или ниже CS4 невозможно?
Re[Boras]:
CS3 отпадает, он не поддерживает технологию Pixel Bender
тогда GIMP, к тому же он бесплатный
плагин MathMap поиском в гугле, у меня не встал на последнюю версию, пришлось вернуться к предыдущей
да и математика не мой конёк к сожалению, а без неё можно, но сложно
на фликре есть группа Droste, могут подсказать, только английский нужен на уровне понимания
http://www.flickr.com/groups/escherdroste/
и группа по Mathmap
http://www.flickr.com/groups/mathmap/
короче, полгода тренировки -:)
тогда GIMP, к тому же он бесплатный
плагин MathMap поиском в гугле, у меня не встал на последнюю версию, пришлось вернуться к предыдущей
да и математика не мой конёк к сожалению, а без неё можно, но сложно
на фликре есть группа Droste, могут подсказать, только английский нужен на уровне понимания
http://www.flickr.com/groups/escherdroste/
и группа по Mathmap
http://www.flickr.com/groups/mathmap/
короче, полгода тренировки -:)
Re[Brandon]:
от:Brandon
CS3 отпадает, он не поддерживает технологию Pixel Bender
тогда GIMP, к тому же он бесплатный
плагин MathMap поиском в гугле, у меня не встал на последнюю версию, пришлось вернуться к предыдущей
да и математика не мой конёк к сожалению, а без неё можно, но сложно
на фликре есть группа Droste, могут подсказать, только английский нужен на уровне понимания
http://www.flickr.com/groups/escherdroste/
и группа по Mathmap
http://www.flickr.com/groups/mathmap/
короче, полгода тренировки -:)Подробнее
Спасибо! Гимп у меня есть. Но вы сказали, что не каждая его версия годится для этого???
Re[Boras]:
надо проверять на апдейты
посмотрите на фликре свежие ссылки на плагин по второй ссылке
я уже полгода не касался гимпа
посмотрите на фликре свежие ссылки на плагин по второй ссылке
я уже полгода не касался гимпа