home *** CD-ROM | disk | FTP | other *** search
- // "Gougepot" a Polyray 1.6 scene file based on the "Utah Teapot"
- // By Douglas Otwell
- //----------------------------------------------------------------------------
- // In Gougepot, I use noise in the displacement function to get a random
- // gouged-out texture by displacing the surface in the opposite direction to
- // the surface normal, if the noise is over a certain threshold. I'm also
- // using Polyray's texture_map to determine the texture (wooden or shiny_red)
- // based on the same noise function.
- //----------------------------------------------------------------------------
-
- // point these to the standard Polyray include files
- include "../colors.inc"
- include "../texture.inc"
-
- viewpoint {
- from <0, 4, -5.0>
- at <0.25, 1, 0>
- up <0, 1, 0>
- angle 53
- resolution 640, 480
- aspect 1.33333
- }
-
- background SkyBlue
- light <-10, 10, -5>
- light <10, 10, -10>
-
- //----------------------------------------------------------------------------
- // This is the teapot texture. The texture map is indexed
- // with the same function as used for the displacement surface
- //----------------------------------------------------------------------------
- define lacquered_wood_texture texture {
- indexed noise(6 * P, 1),
- texture_map ([0.0, 0.6, shiny_red, shiny_red],
- [0.6, 1.0, wooden {scale <0.1, 0.1, 0.1>},
- wooden {scale <0.1, 0.1, 0.1>}]
- )
- }
-
- define rim_texture lacquered_wood_texture
- define body1_texture lacquered_wood_texture
- define body2_texture lacquered_wood_texture
- define spout_texture lacquered_wood_texture
- define handle_texture lacquered_wood_texture
- define lid1_texture lacquered_wood_texture
- define lid2_texture lacquered_wood_texture
- define bottom_texture lacquered_wood_texture
-
- //----------------------------------------------------------------------------
- // Here's the displacement function. If the noise value is greter than the
- // threshold, then the difference is used to displace the surface inward,
- // in the direction opposite to the normal, N.
- //----------------------------------------------------------------------------
- define gouge_fn
- (noise(6 * P, 1) > 0.6
- ? (noise(6 * P, 1) - 0.6) * N * -0.5
- : 0)
-
- define rim_fn gouge_fn
- define body1_fn gouge_fn
- define body2_fn gouge_fn
- define lid1_fn gouge_fn
- define lid2_fn gouge_fn
- define spout_fn gouge_fn
- define handle_fn gouge_fn
- define bottom_fn gouge_fn
-
- define u_res 8
- define v_res 8
-
- include "mypot.inc"
-
- teapot
-
-