"Noise" drawing...
Posted: Thu May 10, 2007 5:32 am
here is a way to draw pixles that shade from the center(darkest) to the edges(lightest) with shading from the middle,
put any of these codes in the draw actor event of your canvas:
code with "noise" and shading,
code with just shading,
code with just "noise"
:D:D
just another random canvas function,
although it is not as cool as Gogo's canvas thing.
put any of these codes in the draw actor event of your canvas:
code with "noise" and shading,
- Code: Select all
float i, i2, R, G, B;
while(i < width)
{
for(i2 = 0; i2 < height; i2++)
{
R = rand(55) + (distance(i, i2, x + width / 2, y + height / 2 ) * (width/2)) / 200;
G = rand(55) + (distance(i, i2, x + width / 2, y + height / 2 ) * (width/2)) / 200;
B = rand(55) + (distance(i, i2, x + width / 2, y + height / 2 ) * (width/2)) / 200;
setpen(R, G, B, 0, 1);
putpixel(i, i2);
}
i++;
}
while(i2 >= height)i2 = 0;
while(i >= height)i = 0;
code with just shading,
- Code: Select all
float i, i2, R, G, B;
while(i < width)
{
for(i2 = 0; i2 < height; i2++)
{
R = (distance(i, i2, x + width / 2, y + height / 2 ) * (width/2)) / 200;
G = R
B = G
setpen(R, G, B, 0, 1);
putpixel(i, i2);
}
i++;
}
while(i2 >= height)i2 = 0;
while(i >= height)i = 0;
code with just "noise"
- Code: Select all
float i, i2, R, G, B;
while(i < width)
{
for(i2 = 0; i2 < height; i2++)
{
R = rand(255);
G = rand(255);
B = rand(255);
setpen(R, G, B, 0, 1);
putpixel(i, i2);
}
i++;
}
while(i2 >= height)i2 = 0;
while(i >= height)i = 0;
:D:D
just another random canvas function,
although it is not as cool as Gogo's canvas thing.