# Makefile para processar as entregas do exercício tp02 de POV-Ray # Last edited on 2001-06-25 22:50:58 by stolfi MAIN = main OTHERINPUTS = POVRAY = /n/lac/pkg/povray-3.1a-1/PUB/intel-Linux/bin/x-povray POVINC = /n/lac/pkg/povray-3.1a-1/PUB/intel-Linux/povinc POVTTF = /home/staff/stolfi/PUB/povray/tt-fonts IMVIEW = /usr/X11R6/bin/display CONVERT = /usr/X11R6/bin/convert TOOLDIR = /home/staff/stolfi/public_html/mp004-2001-1-A/progs/tools .PHONY: \ all single first middle last \ strip showstrip \ fast showfas \ movie showmovie \ cleanup \ frame frameicon showframe \ all-movies index all: first middle last strip movie # "make first" mostra o primeiro quadro da animação: # first: ${MAKE} CLOCK=0.0000 single; # "make middle" mostra o quadro central da animação: # middle: ${MAKE} CLOCK=0.5000 single; # "make last" mostra o quadro final da animação: # last: ${MAKE} CLOCK=1.0000 single; # "make CLOCK=N.NNNN single" gera um quadro com o valor de clock especificado: # SINGLENAME = ${MAIN} SINGLEWIDTH = 400 SINGLEHEIGHT = 300 SINGLERAYS = 2 single: ${MAKE} NAME=${SINGLENAME} CLOCK=`printf "%6.4f" ${CLOCK}` \ WIDTH=${SINGLEWIDTH} HEIGHT=${SINGLEHEIGHT} \ NRAYS=${SINGLERAYS} SHOW='+D' \ frame frameicon # "make strip" mostra filme em forma de tiras, com 15 quadros médios: # STRIPNAME = ${MAIN}-s STRIPWIDTH = 200 STRIPHEIGHT = 150 STRIPRAYS = 1 STRIPCLOCKS = \ 0.0000 0.0714 0.1429 0.2143 0.2857 \ 0.3571 0.4286 0.5000 0.5714 0.6429 \ 0.7143 0.7857 0.8571 0.9286 1.0000 strip: /bin/rm -f ${STRIPNAME}.jpg for clock in ${STRIPCLOCKS} ; do \ ${MAKE} NAME=${STRIPNAME} CLOCK=$$clock \ WIDTH=${STRIPWIDTH} HEIGHT=${STRIPHEIGHT} \ NRAYS=${STRIPRAYS} SHOW='+D' \ frame; \ done ${TOOLDIR}/tile-movie-frames -ncols 5 ${STRIPNAME}.jpg ${STRIPNAME}-*.*.jpg showstrip: -${IMVIEW} ${STRIPNAME}.jpg # "make fast" mostra filme rápido (velocidade × 4) com 5 quadros médios: # FASTNAME = ${MAIN}-f FASTWIDTH = 200 FASTHEIGHT = 150 FASTRAYS = 1 FASTCLOCKS = \ 0.0000 0.0417 0.0833 0.1250 0.1667 \ 0.2083 0.2500 0.2917 0.3333 0.3750 \ 0.4167 0.4583 0.5000 0.5417 0.5833 \ 0.6250 0.6667 0.7083 0.7500 0.7917 \ 0.8333 0.8750 0.9167 0.9583 1.0000 fast: /bin/rm -f ${FASTNAME}.gif for clock in ${FASTCLOCKS} ; do \ ${MAKE} NAME=${FASTNAME} CLOCK=$$clock \ WIDTH=${FASTWIDTH} HEIGHT=${FASTHEIGHT} \ NRAYS=${FASTRAYS} SHOW='-D' \ frame; \ done ${TOOLDIR}/animate-movie-frames -delay 10 ${FASTNAME}.gif ${FASTNAME}-*.*.jpg showfast: -${IMVIEW} -delay 10 ${FASTNAME}.gif # "make movie" mostra filme (em velocidade normal) com 21 quadros pequenos: # MOVIENAME = ${MAIN}-m MOVIEWIDTH = 160 MOVIEHEIGHT = 120 MOVIERAYS = 2 MOVIECLOCKS = \ 0.0000 0.0200 0.0400 0.0600 0.0800 \ 0.1000 0.1200 0.1400 0.1600 0.1800 \ 0.2000 0.2200 0.2400 0.2600 0.2800 \ 0.3000 0.3200 0.3400 0.3600 0.3800 \ 0.4000 0.4200 0.4400 0.4600 0.4800 \ 0.5000 0.5200 0.5400 0.5600 0.5800 \ 0.6000 0.6200 0.6400 0.6600 0.6800 \ 0.7000 0.7200 0.7400 0.7600 0.7800 \ 0.8000 0.8200 0.8400 0.8600 0.8800 \ 0.9000 0.9200 0.9400 0.9600 0.9800 \ 1.0000 movie: /bin/rm -f ${MOVIENAME}.gif for clock in ${MOVIECLOCKS} ; do \ ${MAKE} NAME=${MOVIENAME} CLOCK=$$clock \ WIDTH=${MOVIEWIDTH} HEIGHT=${MOVIEHEIGHT} \ NRAYS=${MOVIERAYS} SHOW='-D' \ frame; \ done ${TOOLDIR}/animate-movie-frames -delay 10 ${MOVIENAME}.gif ${MOVIENAME}-*.*.jpg showmovie: -${IMVIEW} -delay 50 ${MOVIENAME}.gif # "make cleanup" remove todos os arquivos gerados # cleanup: -/bin/rm -f ${MAIN}-*.png ${MAIN}-*.jpg ${MAIN}-*.gif ${MAIN}-*.log -/bin/rm -f ${MAIN}.png ${MAIN}.jpg ${MAIN}.gif ${MAIN}.log # Comandos genéricos usados pelos comandos acima: FRAME = ${NAME}-${CLOCK} FRAMEICON = ${FRAME}-i ICONHEIGHT = 60 frame: ${FRAME}.jpg frameicon: ${FRAMEICON}.jpg showframe: -${IMVIEW} ${FRAME}.jpg ${FRAME}.jpg: ${FRAME}.png -/bin/rm -f ${FRAME}.jpg ${FRAME}.jpg ${CONVERT} -quality 95 ${FRAME}.png ${FRAME}.jpg ${FRAME}.png: ${MAIN}.pov ${OTHERINPUTS} -/bin/rm -f ${FRAME}.png ${POVRAY} +A0 +FN +Q9 +R${NRAYS} \ +W${WIDTH} +H${HEIGHT} +K${CLOCK} \ $${SHOW} +SP32 +EP4 \ +L$${HOME}/lib/povray +L${POVINC} +L${POVTTF} \ +I${MAIN}.pov \ +O${FRAME}.png \ 3>&2 | tee ${FRAME}.log ${FRAMEICON}.jpg: ${FRAME}.png ${CONVERT} ${FRAME}.png ${FRAME}.ppm cat ${FRAME}.ppm \ | pnmscale -ysize 60 \ | pnmdepth 255 \ | ppmquant 254 \ > ${FRAMEICON}.ppm ${CONVERT} -quality 95 ${FRAMEICON}.ppm ${FRAMEICON}.jpg -/bin/rm ${FRAME}.ppm ${FRAMEICON}.ppm # For the whole class: # all-movies: ras.txt ../../../tools/make-all-movies `cat ras.txt` index: title.txt ras.txt ../../../tools/make-labday-movie-page "`cat title.txt`"