home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Resource Library: Graphics
/
graphics-16000.iso
/
msdos
/
raytrace
/
rayshade
/
examples
/
csg.ray
< prev
next >
Wrap
Text File
|
1992-02-09
|
2KB
|
121 lines
/*
* csg wood block (apologies to Hofstadter)
*
* Eric Haines
*
*/
name letter_c
difference
list
cylinder 1 0 0 -1.0 0 0 1.0
disc 1 0 0 -1.0 0 0 -1
disc 1 0 0 1.0 0 0 1
end
union
list
cylinder 0.55 0 0 -1.2 0 0 1.2
disc 0.55 0 0 -1.2 0 0 -1
disc 0.55 0 0 1.2 0 0 1
end
box 0. -.3 -1.2 1.2 0.3 1.2
end
end
name s1 /* outer top part of s */
list
cylinder 0.6125 -0.3875 0.3875 -1.0 -0.3875 0.3875 1.0
disc 0.6125 -0.3875 0.3875 -1.0 0 0 -1
disc 0.6125 -0.3875 0.3875 1.0 0 0 1
cylinder 0.6125 0.3875 -0.3875 -1.0 0.3875 -0.3875 1.0
disc 0.6125 0.3875 -0.3875 -1.0 0 0 -1
disc 0.6125 0.3875 -0.3875 1.0 0 0 1
end
name s3 /* all inner part of s */
union
list
cylinder 0.1625 -0.3875 0.3875 -1.2 -0.3875 0.3875 1.2
disc 0.1625 -0.3875 0.3875 -1.2 0 0 -1
disc 0.1625 -0.3875 0.3875 1.2 0 0 1
cylinder 0.1625 0.3875 -0.3875 -1.2 0.3875 -0.3875 1.2
disc 0.1625 0.3875 -0.3875 -1.2 0 0 -1
disc 0.1625 0.3875 -0.3875 1.2 0 0 1
end
box -.3875 -1.2 -1.2 .3875 1.2 1.2
end
name letter_s
union
union
union
difference
object s1
object s3
end
box -0.3875 0.55 -1 1 1 1
end
box -0.3875 -0.225 -1 0.3875 0.225 1
end
box -1 -1 -1 0.3875 -0.55 1
end
name g3 /*all inner of g */
union
list
cylinder 0.55 0 0 -1.2 0 0 1.2
disc 0.55 0 0 -1.2 0 0 -1
disc 0.55 0 0 1.2 0 0 1
end
box 0. 0. -1.2 1.2 0.425 1.2
end
name letter_g
union
difference
list /* outer part of g */
cylinder 1.0 0 0 -1.0 0 0 1.0
disc 1 0 0 -1.0 0 0 -1
disc 1 0 0 1.0 0 0 1
end
object g3
end
box 0.25 -0.3375 -1.2 1.05 0.1125 1.2
end
name csg
difference
difference
object letter_s rotate 1 0 0 90
object letter_c rotate 1 0 0 90 rotate 0 0 1 90
scale 1.2 0.8 0.8
end
object letter_g scale 0.8 0.8 1.2
/* scaling here is to avoid coincident surfaces */
end
surface white ambient .1 .1 .1 diffuse .5 .5 .5
surface s1 ambient .5 .4 .3 diffuse .25 .2 .15
surface lgreen ambient .07 .1 .07
diffuse .42 .6 .42
specular .28 .4 .28 specpow 10
plane white 0 0 -3 0 0 1
plane white 0 3 0 0 -1 0
plane white -3 0 0 1 0 0
object s1 csg /* texture wood scale 3 3 3*/
light 0.8 directional 0 0 1
light 0.7 directional 0 -1 0
light 0.6 directional 1 0 0
background .1 .3 .8
eyep 10. -13 8.
lookp 0 0 -0.3
up 0 0 1
fov 20.