Upload
others
View
9
Download
0
Embed Size (px)
Citation preview
Cylinder Reflections The Mathematics Behind the Images
Cylinder ReflectionsThe Mathematics Behind the Images
Dr. Don SpicklerDr. Jennifer Bergner
Salisbury University
[email protected]@salisbury.edu
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 1 / 36
Anamorphic Art What is it?
Anamorphic Art
Anamorphic art is created by distorting animage so that is only revealed from a singlevantage point or from its reflection on amirrored surface. This artistic process wasfirst attempted during the Renaissance andbecame exceedingly popular during theVictorian Era.
The earliest known examples come from thenotebooks of Leonardo da Vinci. Hesuccessfully sketched an eyeball in 1485 thatcould only be discerned when looking at thedrawing from a certain angle.
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 2 / 36
Anamorphic Art What is it?
Anamorphic Art
More modern artists using these techniquesinclude Julian Beever, who createsthree-dimensional illusions on sidewalksusing chalk.
Julian Beever’s Fountain
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 3 / 36
Anamorphic Art What is it?
Anamorphic Art
Julian Beever’s Fishing
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 4 / 36
Anamorphic Art What is it?
Anamorphic Art
Julian Beever’s Rafting
As you can see, Julian Beever likes toincorporate human subjects in all of hissidewalk art. This shows that not only canhe create the perspective shift but he can doit to scale.
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 5 / 36
Anamorphic Art What is it?
Anamorphic Art
Hans Hamngren and Istvan Orosz usethe mirrored cylinder technique. Theyachieve this illusion by either drawingthe image on a distorted grid, similarto the way M. C. Escher createdmany of his illusions, or looking at themirrored image while drawing on aflat surface.
Pictured to the left is the work ofIstvan Orosz.
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 6 / 36
Anamorphic Art What is it?
Anamorphic Art
More of Istvan Orosz’s work.
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 7 / 36
Anamorphic Art What is it?
Anamorphic Art
This is a work by Hans Hamngren, an old firehydrant in an old fire extinguisher.
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 8 / 36
The Process Step 1: The Setup
The Process
Step 1: The Setup — Cylinder
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 9 / 36
The Process Step 1: The Setup
The Process
Step 1: The Setup — Paper
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 10 / 36
The Process Step 1: The Setup
The Process
Step 1: The Setup — Viewer Position
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 11 / 36
The Process Step 1: The Setup
The Process
Step 1: The Setup — The Final Image
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 12 / 36
The Process Step 1: The Setup
The Process
Step 1: The Setup — Place the image in the cylinder.
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 13 / 36
The Process Step 2: Draw a line from pixel to viewer.
The Process
Step 2: Draw a line from pixel to viewer.
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 14 / 36
The Process Step 3: Find the intersection with cylinder.
The Process
Step 3: Find the intersection with cylinder.
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 15 / 36
The Process Step 3: Find the intersection with cylinder.
The Process
Step 3: Consider the line from intersection to viewer.
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 16 / 36
The Process Step 4: Find the normal line from intersection.
The Process
Step 4: Find normal line from intersection.
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 17 / 36
The Process Step 5: Find the reflection line from intersection.
The Process
Step 5: Find the reflection line from intersection.
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 18 / 36
The Process Step 6: Find the intersection of reflection line and paper.
The Process
Step 6: Find the intersection of reflection line and paper.
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 19 / 36
The Process Step 6: Plot the point.
The Process
Step 6: Plot the point.
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 20 / 36
The Process Step 6: Repeat for all pixels on the image.
The Process
Step 6: Repeat for all pixels on the image.
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 21 / 36
The Mathematics Step 1: The Setup
The Mathematics
Step 1: The Setup
Assumptions: The base of the cylinder ison the xy -plane, the central axis passesthrough the origin, and the paper is on thexy -plane.
P = 〈px , py , pz〉V = 〈vx , vy , vz〉r 2 = x2 + y 2
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 22 / 36
The Mathematics Step 2: Draw a line from pixel to viewer.
The Mathematics
Step 2: Draw a line from pixel toviewer.
To do this we take the starting position tobe the pixel point P and the direction to betoward the viewer V − P. Thecorresponding formulas are,
L(t) = P + t(V − P)
= 〈px , py , pz〉+ t(〈vx , vy , vz〉 − 〈px , py , pz〉)= 〈px + t(vx − px), py + t(vy − py ), pz + t(vz − pz)〉
As t goes from 0 to 1 we trace out the linesegment from P to V.
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 23 / 36
The Mathematics Step 3: Find the intersection with cylinder.
The Mathematics
Step 3: Find the intersection withcylinder.
To do this we take the line from the pixel tothe viewer and plug the x and y expressionsinto the equation of the cylinder and solvefor t.
r 2 = x2 + y 2
= (px + t(vx − px))2 + (py + t(vy − py ))2
= p2x + p2
y + t(−2p2x − 2p2
y + 2pxvx + 2pyvy )
+ t2(p2x + p2
y − 2pxvx + v 2x − 2pyvy + v 2
y )
= at2 + bt + c
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 24 / 36
The Mathematics Step 3: Find the intersection with cylinder.
The Mathematics
Step 3: Find the intersection withcylinder.
Now solve the quadratic equation,
at2 + bt + c − r 2 = 0
for t and we get,
t =−b ±
√b2 − 4a(c − r 2)
2a
The one we want is
ti =−b +
√b2 − 4a(c − r 2)
2a
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 25 / 36
The Mathematics Step 3: Find the intersection with cylinder.
The Mathematics
Step 3: Find the intersection withcylinder.
Now we substitute this value, ti , in for t inthe line equations to get the point ofintersection.
L(ti) = P + ti(V − P)
= 〈px + ti(vx − px), py + ti(vy − py ), pz + ti(vz − pz)〉= 〈Ix , Iy , Iz〉
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 26 / 36
The Mathematics Step 4: Find the normal vector from intersection.
The Mathematics
Step 4: Find the normal vector fromintersection.
The normal vector is perpendicular to thesurface and is used in the calculation of thereflection line. For a cylinder, the normalvector will be parallel to the xy -plane andpass through the points 〈Ix , Iy , Iz〉 and〈0, 0, Iz〉. So our normal vector is thedifference between these two points,
n = 〈Ix , Iy , 0〉
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 27 / 36
The Mathematics Step 5: Find the reflection vector from intersection.
The Mathematics
Step 5: Find the reflection vector fromintersection.
This is probably the most involvedcalculation in the process. From the diagramon the right notice that the reflection vectorr = v + 2a where v = V − P is the vectorfrom the pixel to the viewer.
SinceProj = v + a
we havea = Proj− v
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 28 / 36
The Mathematics Step 5: Find the reflection vector from intersection.
The Mathematics
Step 5: Find the reflection vector fromintersection.
Proj = Projnv
=n · v|n|2
n
Soa =
n · v|n|2
n− v
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 29 / 36
The Mathematics Step 5: Find the reflection vector from intersection.
The Mathematics
Step 5: Find the reflection vector fromintersection.
r = v + 2a
= v + 2
(n · v|n|2
n− v
)=
2n · v|n|2
n− v
= 〈rx , ry , rz〉
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 30 / 36
The Mathematics Step 5: Find the reflection line from intersection.
The Mathematics
Step 5: Find the reflection line fromintersection.
So our reflection line is
R(t) = 〈Ix , Iy , Iz〉+ t 〈rx , ry , rz〉= 〈Ix + trx , Iy + try , Iz + trz〉
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 31 / 36
The Mathematics Step 6: Find the intersection of reflection line and paper.
The Mathematics
Step 6: Find the intersection ofreflection line and paper.
The paper is on the xy -plane so every threedimensional point on the paper has a zcoordinate of 0. We can use this fact to findhow far we must move down the reflectionvector until we hit the paper, this is thevalue of t in the reflection line formula,
R(t) = 〈Ix + trx , Iy + try , Iz + trz〉
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 32 / 36
The Mathematics Step 6: Find the intersection of reflection line and paper.
The Mathematics
Step 6: Find the intersection ofreflection line and paper.
If we set the z coordinate of the reflectionline equal to 0 we can solve for t,
Iz + trz = 0
gives
t = − Izrz
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 33 / 36
The Mathematics Step 6: Find the intersection of reflection line and paper.
The Mathematics
Step 6: Find the intersection ofreflection line and paper.
Substitute this value in for t in the reflectionline equation gives the intersection point⟨
Ix −Izrzrx , Iy −
Izrzry , Iz −
Izrzrz
⟩which gives⟨
Ix −Izrzrx , Iy −
Izrzry , 0
⟩
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 34 / 36
The Mathematics Step 6: Plot the Point
The Mathematics
Step 6: Plot the Point
Plot this point on the paper in the samecolor as the original pixel color and move onto the next pixel. When all of the points areplotted you have your transformed image.
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 35 / 36
The Mathematics Who did the work?
The Mathematics
Who did the work?
The calculations for this and several other anamorphic scenario weredone as undergraduate research projects by students at SalisburyUniversity.
Jennifer Larson and Kristi Martini (2004) — Cylinder and Sphere
Nicole Massarelli (2010) — Theoretical extensions to generalconvex surfaces. She also wrote the software for cylinderreflections.
Angela Rose and Erika Gerhold (2011) — Tilted Cylinder
Drs. Spickler & Bergner (Salisbury Univ.) Cylinder Reflections November 12, 2011 36 / 36