OFF renderer using SIPP.
Ray Bellis
u87rpb at psy.oxford.ac.uk
Tue Jan 29 22:39:22 AEST 1991
Keywords: tar uuencode
Here's a little something I knocked up earlier this week.
/*-
*
* offtoppm.c
*
* (C) R. P. Bellis 1991
*
* Take an OFF format object and render it into a ppm file.
* Objects with *.pcol or *.ipcol data are rendered using a
* shader which places the polygon colour at each vertex
* using the texture coordinates (could also be used for
* *.vcol files but there aren't very many of them at the
* moment, so I haven't written stuff to handle them yet).
*
* Usage:
* offtoppm <off file> <ppm file> [scale]
*
* Requires:
* SIPP polygon preprocessor library
* OFF Object and C library
* PBM+ for conversion to your favourite file format.
*
* Bugs/ToDo:
* Image size hard coded to 256 x 256.
* Viewing parameters hard coded.
* Can only handle "fff" format colours and vectors.
* Assumes `default' constants are in "fff" format.
* Doesn't handle vertex colours.
* Doesn't know about OFF diffuse reflection coefficent.
* Back faces not handled properly (really a SIPP bug).
*
* License:
* Do with this what you will, just don't claim that
* you wrote it.
*
*/
--8<--8<-- Cut here --8<--8<--
table
!"#$%&'()*+,-./0123456789:;<=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
begin 644 offtoppm.tar.Z
M'YV0+EZ\,6.&SALX<-J\ ,"PH<.'$"-*G$BQHL6*(#+>J%$#!(",(&;$B.$1a
M)(@8,DJ:7 DC(XV-*&MLG-$RHPT8,&Y\O,BSI\^?0(,*'4JTJ-&C2),J51IPa
M8,&#"5\T";.FC)DT;,HLW4H4I T:-%2&'"GV9,J/*VW&" OB98V8&V%TU/A6a
MIT>N>//JW<NWK]^_@$> ())&3IDQ!N6D*3,'1!HW(.Z at 23, at I2:! 1'&a
M#1D03XP842"831HQ<L(H9OSB\1 at V=<@P!C&F,P at Q94"8>5/'LPL%4*0DL1*$a
M2I$O29P,2= #Q LT;]J4>3&GC&DW85ZDSO.BSAPYK=V\CET&N'#BQK\P22*$a
MN7/HTJE;?YQ]>_?O+TR+4:!@B!$F01PQ10+NM? $""TD00(*P0U7W'')#9&"a
M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