George Mills wrote:
>
> And with just a couple rolls added look what you get.
George,
That left me open-mouthed. The checkered cube is extremely beautiful.
You might want to reduce the size from 128 to a smaller value, to have a
somewhat more managable cube. {In my original chessboard I gave the size
128 because it's a power of 2, to bypass rounding errors).
> Note the BETA version did not have "Fill" 3D enabled yet.
>
> The original code was not orientation independent (i.e. it would not
> work if you issued say a rt 5 before drawing it). I modified the code
> to snapshot the orientation (heading) before starting and use the
> difference.
I noticed those modifications in MAIN and CHESS procedures.
> Of course I MSWLogoized it to RGB.
>
> I also had a few rounding errors I'm working on which I worked
> around.
>
> But the basicly the code still runs even when the turtle is standing
> on his head :-)
> =====================================
> to chess :size :level
> if :level<1[stop]
> repeat 4[draw]
> setfloodcolor ifelse 0=remainder round (heading-:startheading+360)
180[[255 0 0]][[0 0 0]]
> fill_it
> setpc [255 255 0] ; lines color
> end
>
> to draw
> fd :size rt 90
> chess :size/2 :level-1
> end
>
> to fill_it
> pu rt 45 fd 10 pd
> fill ; brown or blue
> pu bk 10 lt 45 pd
> end
>
> to main ; Chessboard
> cs
> perspective
> setturtle -1
> setxyz -200 -200 200
> setturtle 0
> make "startheading heading
> chess 128 4
> rr 90
> make "startheading heading
> chess 128 4
> rt 90
> lr 90
> make "startheading heading
> chess 128 4
> end
> =====================================
Great job.
I attach another '3-d' cube, done with plain-vanilla Logo.
Enjoy,
[[Yehuda]]
Global SchoolNet Foundation -
Linking Kids Around the World!
Copyright GSN - All Rights Reserved
- Comments
& Questions
Visit GSN's
Global
Schoolhouse for more exciting learning resources!
Search our Site
-
Home