Pamtris User Manual(0) Pamtris User Manual(0) (NAME) pamtris - (SYNOPSIS) pamtris -width=width -height=height { -num_attribs=attributes_per_vertex [ -tupletype=tupletype ] | -rgb | -grayscale } [ -maxval=maxval ] . . . (DESCRIPTION) Netpbm(1) . pamtris (triangle strips) (triangle fans) . PAM ( ) . mode fan attribs 0 128 0 vertex 0 0 1 attribs 0 0 128 vertex 200 0 1 attribs 50 20 103 vertex 190 61 1 attribs 100 40 78 vertex 161 117 1 attribs 150 60 53 vertex 117 161 1 attribs 200 80 28 vertex 61 190 1 attribs 250 100 3 vertex 0 200 1 print : pamtris FAN (vertices) . <<>> (attribute) maxval . pamtris RGB . . PAM pamtris (frame buffer) << >> (image buffer) << >> (depth buffer) . height width . () . . (depth-sorting) . <<>> . () . pamtris maxval. . pamtris . (depth test) . : ( Z ) . : o i ( 0 ≤ i < num_attribs) ( ) maxval o . . . PAM ( ) (texture coordinates) . (EXAMPLES) (Fan Mode) (DESCRIPTION) <#description> . fan.tris : $ pamtris -height=200 -width=200 -rgb fan.pam (Strip Mode) : mode strip attribs 255 0 0 # red vertex 0 200 1 vertex 50 0 1 attribs 0 0 0 # black vertex 100 200 1 attribs 0 205 205 # cyan vertex 150 0 1 attribs 0 0 255 # blue vertex 200 200 1 vertex 250 0 1 print strip.tris ( ) : $ pamtris -height=200 -width=200 -rgb strip.pam : pamtris STRIP (Triangle Mode) : # yellow square mode strip attrib 155 155 0 vertex 50 50 100 vertex 50 200 100 vertex 200 50 100 vertex 200 200 100 # blue triangle mode triangles attrib 0 205 205 vertex 20 125 70 attrib 0 0 140 vertex 230 70 120 # Change "120" and see what happens vertex 230 180 120 # print pierce.tris ( ) : $ pamtris -height=200 -width=200 -rgb pierce.pam : pamtris TRIANGLES (Meta-programming) pamtris pamtris . draw_polygon C pamtris . vertex . (: PAM pamtris pamscale -linear -xscale 0.25 -yscale 0.25 (anti-aliased) <#antialias> .) /* ----------------------- * * width = 512 * * height = 512 * * num_attribs = 3 * * tupletype = RGB_ALPHA * * ----------------------- */ #include #include #include #define PI 3.14159265358979323844 void draw_polygon (int const center_x, int const center_y, int const radius, int const sides) { printf("mode fan\n" "vertex %d %d 0\n", center_x, center_y); for(int i = 0; i <= sides; i++) { int const x = round(center_x + radius * cos(i*2.0*PI / sides)); int const y = round(center_y - radius * sin(i*2.0*PI / sides)); printf("vertex %d %d 0\n", x, y); } } int main(void) { puts("attribs 0 185 80"); /* color: green */ draw_polygon(300, 210, 150, 5); /* draws pentagon */ puts("attribs 255 15 240"); /* color: magenta */ draw_polygon(150, 320, 100, 7); /* draws heptagon */ puts("!"); } (OPTIONS) libnetpbm ( -quiet (Common Options) ) pamtris :
-width=width PAM . [1, 8192] . . -height=height PAM . [1, 8192] . . -num_attribs=attributes_per_vertex . PAM ( ). [1, 20] . reset . -num_attribs -rgb -grayscale . -tupletype=tupletype PAM . . reset . . -rgb -grayscale . -rgb -num_attribs=3 -tupletype=RGB_ALPHA . pamtris RGB(_ALPHA) . reset . -num_attribs -rgb -grayscale . Netpbm 10.85 ( 2018) . -grayscale -rgb -num_attribs=1 -tupletype=GRAYSCALE_ALPHA . . reset . -num_attribs -rgb -grayscale . Netpbm 10.85 ( 2018) . -maxval=maxval maxval PAM . [1, 65535] . 255 . reset . (INSTRUCTION CODE) pamtris . . # pamtris . # . (token) . pamtris ( ) . . ( ) / . . pamtris (case-insensitive) mode MODE mODe . pamtris : mode attribs vertex print clear reset quit . (!) print (*) clear . : mode { triangles | strip | fan } pamtris . . . mode . () . vertex ( ) . << >> : pamtris . . pamtris . . . ( .) ( ) . triangles pamtris "TRIANGLES" . . . Nth 3*N 3*N + 1 3*N + 2 . . strip pamtris "STRIP" . pamtris << >> . Nth N N + 1 N + 2 . fan pamtris "FAN" . << >> . Nth 0 N + 1 N + 2 . attribs a0 a1 a2 ... anum_attribs - 1 . num_attribs . << >> . ith ( 0 ≤ i < num_attribs) ith . [0, maxval] . num_attribs . attribs reset . attribs reset maxval ( ). maxval .
vertex x y z [w] ( mode ) ( attribs ) . x y z [-32767, 32767] . x y . . . X Y . x . y . <<>> pamtris <<>> . x y pamtris . z Z . z << >> << >> ( : x y z ). w << >> . [1, 1048575] . ( w ). . w Netpbm 10.85 ( 2018) . (viewing frustum) << >> << >> . << z>> (view-plane) w (//) (PRP "") z . (dot product) r n r (PRP "") n (VPN) PRP . r n . (: a b ax ay az bx by bz a b : ax*bx + ay*by + az*bz.) print PAM . WIDTH HEIGHT . MAXVAL maxval DEPTH num_attribs + 1 TUPLTYPE tupletype . . print PAM . clear [ image | depth ] . . . image depth . . z depth . print . reset maxval num_attribs [tupletype] maxval (num_attribs) maxval . maxval [1, 65535] num_attribs [1, 20] . tupletype . ( ) . tupletype tupletype . : o . o maxval . o . : . ( pamtris FAN ). maxval num_attribs maxval num_attribs tupletype . maxval num_attribs . . pamtris quit . quit pamtris . . (TIPS) (Texturing) <<>> (textures) pamtris pamchannel(1) () pamlookup(1) (lookup table) . w vertex ( <#cmd_vertex> ) pamtris . pnmtile(1) . GIF ( nasa.gov ): (Anti-aliased edges) pamtris (anti-aliasing) . << >> (super- sampling) : () () . ( pamscale -linear ) " " / " " . (SEE ALSO) pampick(1) pamchannel(1) pamstack(1) pamlookup(1) pamarith(1) pamscale(1) pamdepth(1) pamexec(1) pam(1) (HISTORY) pamtris Netpbm 10.84 ( 2018) . (DOCUMENT SOURCE) Netpbm 'makeman' HTML . : http://netpbm.sourceforge.net/doc/pamtris.html netpbm documentation 15 April 2021 Pamtris User Manual(0)