Trying to learn some projective geometry. The design ideas page
http://www.contextfreeart.org/mediawiki ... sign_ideas
is a good start until one notices that black "balls" are not organized in a square lattice pattern. Therefore, the recursion should be changed into 2 layers: first we iterate by shifting in (projective plane) X direction, then we shift the whole infinite row of balls in Y direction. Here is my attempt rendering two "parallel" rows of balls:
rule row {
CIRCLE { }
row { s .7 y .6 x .8 }
}
rule 2rows {
row {}
row [rotate 0 y .87 x -0.89 s 1.9 0.8 s 0.7]
}
However, I'm not getting the transformation right. The
rule plane {
row {}
plane [rotate 0 y .87 x -0.89 s 1.9 0.8 s 0.7]
}
fails to make the direction Y to be a straight line.
Anybody succeeded rendering infinite checker board?
checker board 3d?
Moderators: MtnViewJohn, chris, mtnviewmark
-
- Posts: 9
- Joined: Wed May 14, 2008 12:52 pm
- MtnViewJohn
- Site Admin
- Posts: 882
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
This is very close
I suspect that this is as close as you can get using only affine transforms. It probably requires perspective transforms to get it exactly right.
Code: Select all
startshape grid
background {b -0.5}
rule column1 {
SQUARE {r 45 b -1}
column1[y sqrt(0.5) s 1 0.9 y sqrt(0.5)]
}
rule column2 {
SQUARE {r 45 b 1}
column2[y sqrt(0.5) s 1 0.9 y sqrt(0.5)]
}
rule grid1 {
column1{}
grid2[x sqrt(0.5) s sqrt(0.9) y sqrt(0.5)]
}
rule grid2 {
column2{}
grid1[x sqrt(0.5) s sqrt(0.9) y sqrt(0.5)]
}
rule grid {
grid1{s 1 0.8}
grid2[s -1 0.8 x sqrt(0.5) s sqrt(0.9) y sqrt(0.5)]
}
-
- Posts: 9
- Joined: Wed May 14, 2008 12:52 pm
I'm still puzzled if this can be done. The diagonal lines must converge at the middle of horizon, so the skew transform is necessary! One more parameter to tune...
startshape plane
rule lineX {
TRIANGLE { s 2 0.5 skew -30 1 rotate 40 y -2.35 alpha -0.5 }
lineX { s 1 0.55 y -0.73 x 0.61 skew 21 1 }
}
rule plane {
lineX {}
lineX {flip 90 x -0.5 }
}
Perhaps I should abandon this naive brute force attempt and write down formal analytic equations...
startshape plane
rule lineX {
TRIANGLE { s 2 0.5 skew -30 1 rotate 40 y -2.35 alpha -0.5 }
lineX { s 1 0.55 y -0.73 x 0.61 skew 21 1 }
}
rule plane {
lineX {}
lineX {flip 90 x -0.5 }
}
Perhaps I should abandon this naive brute force attempt and write down formal analytic equations...
-
- Posts: 9
- Joined: Wed May 14, 2008 12:52 pm
No matter what I do, I can't get converging parallel lines. Example:
startshape diagonal
rule rtriangle {
TRIANGLE [ b 0.5 alpha -0.5
s 1 0.57
flip 180
y 0.288675135
]
}
rule square {
TRIANGLE { alpha -0.3 y 0.09 s 1 0.31 }
rtriangle { }
}
rule diagonal {
square {}
diagonal { y 0.47 s 0.75 0.4 }
}
The crux of the problem is that the series of equidistant points on the target plane is not a geometric series on the projection plane.
startshape diagonal
rule rtriangle {
TRIANGLE [ b 0.5 alpha -0.5
s 1 0.57
flip 180
y 0.288675135
]
}
rule square {
TRIANGLE { alpha -0.3 y 0.09 s 1 0.31 }
rtriangle { }
}
rule diagonal {
square {}
diagonal { y 0.47 s 0.75 0.4 }
}
The crux of the problem is that the series of equidistant points on the target plane is not a geometric series on the projection plane.