[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LOGO-L> Re: the screw again



See attached GIF

MHELHEFNY@FRCU.EUN.EG wrote:
> 
> ;Hello Turtlers
> ;Here is the screw once again this time the code produces a better
> ;surface using the grid approach.
> ;Best Regards
> ;Mhelhefny
> ;-----------------------------------------------
> TO COL :N
> ;this may be a library procedure
> OP ITEM :N [[255 0 0][0 255 0][0 0 255]
>             [255 255 0][0 0 0][130 130 130]
>             [30 200 200][255 0 255][200 200 100]
>             [120 20 120][200 100 50]]
> END
> 
> to go
> turnon3d grid 20
> end
> 
> to grid :step
> pu gridx :step pu gridz :step
> end
> 
> to gridx :step
> for [x 0 360 :step][for [z 0 1300 :step][setpc col 1 setxyz x y z pd]pu]
> end
> 
> to gridz :step
> for [z 0 1300 :step/2][for [x 0 360 :step/2][setpc col 3 setxyz x y z pd]pu]
> end
> 
> to turnon3d
> perspective
> setturtle -1 setxyz 2000 2000 -2000
> setturtle 0 ht cs
> end
> 
> to x
> op (:z)
> end
> 
> to y
> op (:x* sin :z)+500
> end
> 
> to z
> op (:x*cos :z)
> end
> ;----------------------------------------------

-- 
===============================================================
George Mills (mills@softronix.com)
http://www.softronix.com/
The www page contains some very powerful educational software.
Our single most important investment is our kids.

GIF image



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