Input format
Sphere: sphe xc yc zc r Material (opaque): opaq dR dG dB ks b (Level 1) Material (mirror): mirr (Level 2) Material (transparent): trpa kt n ks b (Level 3) Material (mapping): tmap tex (Level 4) ---- Light (parallel): plig lx ly lz LR LG LB Background: back BR BG BB Ambient light: elig ke ---- Viewpoint: eyep xv yv zv View reference point: refp xf yf zf View angle: vang ha va Image resolution: size is ---- Rendering: rend (fn) Quit: quit
xc, yc, zc, r: center, (xc, yc, zc), and radius, r, of sphere dR, dG, dB: diffuse-reflection coefficient (0 <= dR, dG, dB <= 1) ks: specular-reflection coefficient (0 <= ks <= 1) b: specular-reflection exponent (1 <= b; integer) kt: transmission coefficient (0 <= kt <= 1) n: index of refraction (1 <= n) tex: texture (file name) lx, ly, lz: light vector LR, LG, LB: intensity of light (0 <= LR, LG, LB (<=255)) BR, BG, BB: background color (0 <= BR, BG, BB <=255) ke: ambient-reflection coefficient (0 <= ke <= 1) xv, yv, zv:: viewpoint xf, yf, zf: view reference point ha, va: horizontal and vertical view angles [degree] fn: output file name (image file)
Sample data (LEVEL 1)
Input data
Sample data (LEVEL 2)
Input data
Sample data (LEVEL 3)
Input data
Shading equations
Image file format (SUN color RGB raster file format)
struct rasterfile { int ras_magic; /* magic = 0x59a66a95; */ int ras_width; /* number of pixels in width */ int ras_height; /* number of pixels in height */ int ras_depth; /* depth = 24; */ int ras_length; /* length = 3 * width * height; */ int ras_type; /* type = 1; */ int ras_maptype; /* maptype = 0; */ int ras_maplength; /* maplength = 0; */ } header;
Sample source code (C code)
Sample source code (header file)
Preview software
xview, xv, xloadimage (UNIX)
Adobe Photoshop, Photoshop Elements (Mac/Win)
JAVA document
(By courtesy of Prof. Nishita at University of Tokyo)
JAVA related on graphics
JAVA examples
JAVA link
Send your project to
d319@eml.hiroshima-u.ac.jp