Path: utzoo!utgpu!watmath!iuvax!ndcheg!uceng!mfinegan From: mfinegan@uceng.UC.EDU (michael k finegan) Newsgroups: comp.graphics Subject: Re: mtv raytracer displayed on targa 16 Summary: the short program follows ... Message-ID: <825@uceng.UC.EDU> Date: 31 Mar 89 15:41:16 GMT References: <824@uceng.UC.EDU> Distribution: comp Organization: Univ. of Cincinnati, College of Engg. Lines: 60 I just compiled the mtv raytracing package on a 3B2/400 (SYS_V) and decided to display the "balls.pic" test output on a targa 16. It apparently works! For anyone who has a targa, but is lazier than I am, here is a simplistic routine to display mtv output files (assume <= 400x512) compile with targa tools library, and check my coordinate choice ... mfinegan@uceng.uc.edu Sorry - I forgot to include the program! /* * Display mtv rendered output image file on targa 16 * copyright (c) Michael K. Finegan, 3/1989 * but do what ever you want with it! */ #include #include #include "tardev.h" extern struct TARStruct *targa; unsigned char pixels[1024*3]; main(argc,argv) int argc; char **argv; { unsigned x, xmax, y, ymax, R, G, B, color; FILE *fp, *fopen(); if(GraphInit(-1) == -1) { printf("unable to initialize targa ...\n"); exit(0); } if(argc != 2 || (fp = fopen(argv[1],"rb")) == (FILE *)NULL) { printf("disp_ray file_name\n"); exit(0); } if(fscanf(fp,"%d %d\n",&ymax,&xmax) != 2) fprintf(stderr,"Error reading rows, cols\n"); else printf("Assuming %d rows x %d cols\n",ymax,xmax); for(y=0;y