home *** CD-ROM | disk | FTP | other *** search
- // "Dalipot" a Polyray 1.6 scene file based on the "Utah Teapot"
- // By Douglas Otwell
- //----------------------------------------------------------------------------
- // In Dalipot, I use a power function to displace the pot downwards. The
- // texture, an image map, follows the displacement of the surface using
- // the local coordinate mapping ability of Polyray.
- //----------------------------------------------------------------------------
-
- // point these to the standard Polyray include files
- include "../colors.inc"
- include "../texture.inc"
-
- viewpoint {
- from <2, 3, -6.5>
- at <0,0.5,0>
- up <0,1,0>
- angle 45
- //resolution 160, 120
- //aspect 1.33333 / 1.2
- resolution 640, 480
- aspect 1.33333
- }
-
- background skyblue
- light <20, 4, 0>
- light <-10, 6, -15>
-
- //----------------------------------------------------------------------------
- // Pattern_texture uses an image mapped to the u and v coordinates of
- // the bezier. This way the image follows the displacement of the bezier.
- //----------------------------------------------------------------------------
- define pattern_texture
- texture {
- special surface {
- color planar_imagemap (image ("pattern.tga"), <v, 0, -u>, 1)
- specular white, 0.6
- microfacet Reitz 5
- }
- }
- define white_texture
- texture {
- surface {
- color <0.847, 0.847, 0.847>
- specular white, 0.6
- microfacet Reitz 5
- }
- }
-
- define rim_texture white_texture
- define body1_texture pattern_texture
- define body2_texture white_texture
- define spout_texture white_texture
- define handle_texture white_texture
- define lid1_texture white_texture
- define lid2_texture white_texture
- define bottom_texture white_texture
-
- //----------------------------------------------------------------------------
- // This function will displace the pot downwards proportional to x^2
- //----------------------------------------------------------------------------
- define dali_fn (x > -0.2
- ? <0, -0.5 * (x + 0.2)^2, 0>
- : 0)
-
- define rim_fn dali_fn
- define body1_fn dali_fn
- define body2_fn dali_fn
- define lid1_fn dali_fn
- define lid2_fn dali_fn
- define spout_fn dali_fn
- define handle_fn dali_fn
- define bottom_fn dali_fn
-
- define u_res 5
- define v_res 5
-
- include "mypot.inc"
-
- teapot
-
- object {
- box <-4, -4, -2>, <0, 0, 2>
- shiny_red
- translate <-0.2, 0, 0>
- }
-
-