Example: Fun
Swirl (src, dst, theta):
for (int x = 0; x < xmax; x++) {
for (int y = 0; y < ymax; y++) {
float u = rot(dist(x,xcenter)*theta);
float v = rot(dist(y,ycenter)*theta);
dst(x,y) = resample_src(u,v,w);
}
}
Swirl
45
y
x
v
u
(u,v)
f
(x,y)
Previous slide
Next slide
Back to first slide
View graphic version