home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 1995 January
/
pcw-0195.iso
/
polyray
/
dat
/
misc
/
room1.pi
< prev
next >
Wrap
Text File
|
1994-12-31
|
3KB
|
105 lines
// Test of an environment map to simulate shadowing and reflectivity in a
// scan converted image. We will be generating a depth map for a light source,
// the six faces of an environment map that wrap around a sphere, followed by
// a render of the final image. The last frame generated by this file will be
// the scene contained in the file room2.inc, plus a sphere reflecting the
// objects in that file.
//
// Polyray input file: Alexander Enzmann
// Generate eight frames, the first generates a depth map for doing shadowing
// of the light source. The next six generate one image for each direction of
// the environment map around the reflective sphere. The final frame is the
// full image, including shadowing and reflectivity.
start_frame 0
end_frame 7
// This is where the reflective sphere will be (this definition must come
// before the file rsphere.inc in read).
define sphere_location <0, 0, 0>
// These two arrays are used to generate orientations for an environment map
define at_vecs [<1, 0, 0>, <-1, 0, 0>, < 0, 1, 0>, < 0,-1, 0>, < 0, 0, 1>,
< 0, 0,-1>]
define up_vecs [< 0, 1, 0>, < 0, 1, 0>, < 0, 0, 1>, < 0, 0,-1>, < 0, 1, 0>,
< 0, 1, 0>]
// Define the characteristics of the light.
define light_location <-10, 30, -2>
define light_at <0, 0, 0>
define light_up <0, 1, 0>
define light_angle 45
define light_aspect 4/3
if (frame > 0)
// We only use the light after it's depth map has been generated
depthmapped_light {
color white
depth "out000.tga"
from light_location
at light_at
up light_up
angle light_angle
aspect light_aspect
hither 0.3
}
// Grab the standard set of colors and set the background color
include "..\colors.inc"
background Midnight_Blue
// Base the orientation of the camera on the frame number. The first six
// frames are used to generate the environment map, the final frame is
// used to generate the actual image.
if (frame == 0) {
// Generate depth information for the light source
define from_vec light_location
define at_vec light_at
define up_vec light_up
define x_res 480
define y_res 360
define view_angle light_angle
define image_aspect light_aspect
define view_form 1
}
else if (frame < 7) {
// Generate the images for the environment map
define from_vec sphere_location
define at_vec sphere_location + at_vecs[frame-1]
define up_vec up_vecs[frame-1]
define x_res 64
define y_res 64
define view_angle 90
define image_aspect 1
define view_form 0
}
else {
// At last we are generating the full image. Pull in the environment
// mapped sphere and define the viewpoint for the image.
// define from_vec rotate(<0, 6, -8>, <0, -60, 0>)
define from_vec <0, 6, -8>
define at_vec <0, 0, 0>
define up_vec <0, 1, 0>
define x_res 256
define y_res 256
define view_angle 60
define image_aspect 1
define view_form 0
}
// The viewpoint will change based on what we are rendering.
viewpoint {
from from_vec
at at_vec
up up_vec
angle view_angle
resolution x_res, y_res
aspect image_aspect
image_format view_form
}
// Read in the scene definition
include "room2.inc"
// Read in the object that we are building the environment map for.
include "rsphere.inc"