home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / OPENSTEP / Languages / Python / python-14-src / Doc / libgl.tex / node1_ct.html < prev    next >
LaTeX Document  |  1997-01-17  |  5.1 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: LaTeX Document (document/latex).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
90% dexvert Hypertext Markup Language File (text/html) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file HTML document text default (weak)
99% file Python script text executable default (weak)
98% file LaTeX document text default
97% file exported SGML document text default
96% file exported SGML document, ASCII text default
80% TrID HyperText Markup Language with DOCTYPE default
19% TrID HyperText Markup Language default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% gt2 HTML (Hyper Text Markup Language) Datei default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime text/html default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 3c 21 44 4f 43 54 59 50 | 45 20 48 54 4d 4c 20 50 |<!DOCTYP|E HTML P|
|00000010| 55 42 4c 49 43 20 22 2d | 2f 2f 57 33 43 2f 2f 44 |UBLIC "-|//W3C//D|
|00000020| 54 44 20 48 54 4d 4c 20 | 33 2e 32 20 46 69 6e 61 |TD HTML |3.2 Fina|
|00000030| 6c 2f 2f 65 6e 22 3e 0a | 0a 3c 21 2d 2d 43 6f 6e |l//en">.|.<!--Con|
|00000040| 76 65 72 74 65 64 20 77 | 69 74 68 20 4c 61 54 65 |verted w|ith LaTe|
|00000050| 58 32 48 54 4d 4c 20 32 | 30 32 32 20 28 52 65 6c |X2HTML 2|022 (Rel|
|00000060| 65 61 73 65 64 20 4a 61 | 6e 75 61 72 79 20 31 2c |eased Ja|nuary 1,|
|00000070| 20 32 30 32 32 29 20 2d | 2d 3e 0a 3c 48 54 4d 4c | 2022) -|->.<HTML|
|00000080| 20 6c 61 6e 67 3d 22 65 | 6e 22 3e 0a 3c 48 45 41 | lang="e|n">.<HEA|
|00000090| 44 3e 0a 3c 54 49 54 4c | 45 3e 43 6f 6e 74 65 6e |D>.<TITL|E>Conten|
|000000a0| 74 73 20 6f 66 20 42 75 | 69 6c 74 2d 69 6e 20 4d |ts of Bu|ilt-in M|
|000000b0| 6f 64 75 6c 65 20 67 6c | 3c 2f 54 49 54 4c 45 3e |odule gl|</TITLE>|
|000000c0| 0a 0a 3c 4d 45 54 41 20 | 48 54 54 50 2d 45 51 55 |..<META |HTTP-EQU|
|000000d0| 49 56 3d 22 43 6f 6e 74 | 65 6e 74 2d 54 79 70 65 |IV="Cont|ent-Type|
|000000e0| 22 20 43 4f 4e 54 45 4e | 54 3d 22 74 65 78 74 2f |" CONTEN|T="text/|
|000000f0| 68 74 6d 6c 3b 20 63 68 | 61 72 73 65 74 3d 75 74 |html; ch|arset=ut|
|00000100| 66 2d 38 22 3e 0a 3c 4d | 45 54 41 20 4e 41 4d 45 |f-8">.<M|ETA NAME|
|00000110| 3d 22 76 69 65 77 70 6f | 72 74 22 20 43 4f 4e 54 |="viewpo|rt" CONT|
|00000120| 45 4e 54 3d 22 77 69 64 | 74 68 3d 64 65 76 69 63 |ENT="wid|th=devic|
|00000130| 65 2d 77 69 64 74 68 2c | 20 69 6e 69 74 69 61 6c |e-width,| initial|
|00000140| 2d 73 63 61 6c 65 3d 31 | 2e 30 22 3e 0a 3c 4d 45 |-scale=1|.0">.<ME|
|00000150| 54 41 20 4e 41 4d 45 3d | 22 47 65 6e 65 72 61 74 |TA NAME=|"Generat|
|00000160| 6f 72 22 20 43 4f 4e 54 | 45 4e 54 3d 22 4c 61 54 |or" CONT|ENT="LaT|
|00000170| 65 58 32 48 54 4d 4c 20 | 76 32 30 32 32 22 3e 0a |eX2HTML |v2022">.|
|00000180| 0a 3c 4c 49 4e 4b 20 52 | 45 4c 3d 22 53 54 59 4c |.<LINK R|EL="STYL|
|00000190| 45 53 48 45 45 54 22 20 | 48 52 45 46 3d 22 6c 69 |ESHEET" |HREF="li|
|000001a0| 62 67 6c 2e 63 73 73 22 | 3e 0a 0a 3c 4c 49 4e 4b |bgl.css"|>..<LINK|
|000001b0| 20 52 45 4c 3d 22 6e 65 | 78 74 22 20 48 52 45 46 | REL="ne|xt" HREF|
|000001c0| 3d 22 6e 6f 64 65 32 5f | 6d 6e 2e 68 74 6d 6c 22 |="node2_|mn.html"|
|000001d0| 3e 0a 3c 4c 49 4e 4b 20 | 52 45 4c 3d 22 70 72 65 |>.<LINK |REL="pre|
|000001e0| 76 69 6f 75 73 22 20 48 | 52 45 46 3d 22 6c 69 62 |vious" H|REF="lib|
|000001f0| 67 6c 5f 6d 6e 2e 68 74 | 6d 6c 22 3e 0a 3c 4c 49 |gl_mn.ht|ml">.<LI|
|00000200| 4e 4b 20 52 45 4c 3d 22 | 75 70 22 20 48 52 45 46 |NK REL="|up" HREF|
|00000210| 3d 22 6c 69 62 67 6c 5f | 6d 6e 2e 68 74 6d 6c 22 |="libgl_|mn.html"|
|00000220| 3e 0a 3c 4c 49 4e 4b 20 | 52 45 4c 3d 22 6e 65 78 |>.<LINK |REL="nex|
|00000230| 74 22 20 48 52 45 46 3d | 22 6e 6f 64 65 32 5f 6d |t" HREF=|"node2_m|
|00000240| 6e 2e 68 74 6d 6c 22 3e | 0a 3c 2f 48 45 41 44 3e |n.html">|.</HEAD>|
|00000250| 0a 20 0a 3c 42 4f 44 59 | 20 62 67 63 6f 6c 6f 72 |. .<BODY| bgcolor|
|00000260| 3d 22 23 66 66 66 66 66 | 66 22 20 74 65 78 74 3d |="#fffff|f" text=|
|00000270| 22 23 30 30 30 30 30 30 | 22 20 6c 69 6e 6b 3d 22 |"#000000|" link="|
|00000280| 23 39 39 34 34 45 45 22 | 20 76 6c 69 6e 6b 3d 22 |#9944EE"| vlink="|
|00000290| 23 30 30 30 30 66 66 22 | 20 61 6c 69 6e 6b 3d 22 |#0000ff"| alink="|
|000002a0| 23 30 30 66 66 30 30 22 | 3e 0a 0a 3c 48 31 3e 3c |#00ff00"|>..<H1><|
|000002b0| 41 20 49 44 3d 22 53 45 | 43 54 49 4f 4e 30 30 30 |A ID="SE|CTION000|
|000002c0| 31 30 30 30 30 30 30 30 | 30 30 30 30 30 30 30 30 |10000000|00000000|
|000002d0| 30 22 3e 0a 42 75 69 6c | 74 2d 69 6e 20 4d 6f 64 |0">.Buil|t-in Mod|
|000002e0| 75 6c 65 20 67 6c 3c 2f | 41 3e 0a 3c 2f 48 31 3e |ule gl</|A>.</H1>|
|000002f0| 0a 67 6c 0a 0a 3c 50 3e | 0a 54 68 69 73 20 6d 6f |.gl..<P>|.This mo|
|00000300| 64 75 6c 65 20 70 72 6f | 76 69 64 65 73 20 61 63 |dule pro|vides ac|
|00000310| 63 65 73 73 20 74 6f 20 | 74 68 65 20 53 69 6c 69 |cess to |the Sili|
|00000320| 63 6f 6e 20 47 72 61 70 | 68 69 63 73 0a 3c 45 4d |con Grap|hics.<EM|
|00000330| 3e 47 72 61 70 68 69 63 | 73 20 4c 69 62 72 61 72 |>Graphic|s Librar|
|00000340| 79 3c 2f 45 4d 3e 2e 0a | 49 74 20 69 73 20 61 76 |y</EM>..|It is av|
|00000350| 61 69 6c 61 62 6c 65 20 | 6f 6e 6c 79 20 6f 6e 20 |ailable |only on |
|00000360| 53 69 6c 69 63 6f 6e 20 | 47 72 61 70 68 69 63 73 |Silicon |Graphics|
|00000370| 20 6d 61 63 68 69 6e 65 | 73 2e 0a 0a 3c 50 3e 0a | machine|s...<P>.|
|00000380| 57 61 72 6e 69 6e 67 3a | 0a 53 6f 6d 65 20 69 6c |Warning:|.Some il|
|00000390| 6c 65 67 61 6c 20 63 61 | 6c 6c 73 20 74 6f 20 74 |legal ca|lls to t|
|000003a0| 68 65 20 47 4c 20 6c 69 | 62 72 61 72 79 20 63 61 |he GL li|brary ca|
|000003b0| 75 73 65 20 74 68 65 20 | 50 79 74 68 6f 6e 20 69 |use the |Python i|
|000003c0| 6e 74 65 72 70 72 65 74 | 65 72 20 74 6f 20 64 75 |nterpret|er to du|
|000003d0| 6d 70 0a 63 6f 72 65 2e | 0a 49 6e 20 70 61 72 74 |mp.core.|.In part|
|000003e0| 69 63 75 6c 61 72 2c 20 | 74 68 65 20 75 73 65 20 |icular, |the use |
|000003f0| 6f 66 20 6d 6f 73 74 20 | 47 4c 20 63 61 6c 6c 73 |of most |GL calls|
|00000400| 20 69 73 20 75 6e 73 61 | 66 65 20 62 65 66 6f 72 | is unsa|fe befor|
|00000410| 65 20 74 68 65 20 66 69 | 72 73 74 0a 77 69 6e 64 |e the fi|rst.wind|
|00000420| 6f 77 20 69 73 20 6f 70 | 65 6e 65 64 2e 0a 0a 3c |ow is op|ened...<|
|00000430| 50 3e 0a 54 68 65 20 6d | 6f 64 75 6c 65 20 69 73 |P>.The m|odule is|
|00000440| 20 74 6f 6f 20 6c 61 72 | 67 65 20 74 6f 20 64 6f | too lar|ge to do|
|00000450| 63 75 6d 65 6e 74 20 68 | 65 72 65 20 69 6e 20 69 |cument h|ere in i|
|00000460| 74 73 20 65 6e 74 69 72 | 65 74 79 2c 20 62 75 74 |ts entir|ety, but|
|00000470| 20 74 68 65 0a 66 6f 6c | 6c 6f 77 69 6e 67 20 73 | the.fol|lowing s|
|00000480| 68 6f 75 6c 64 20 68 65 | 6c 70 20 79 6f 75 20 74 |hould he|lp you t|
|00000490| 6f 20 67 65 74 20 73 74 | 61 72 74 65 64 2e 0a 54 |o get st|arted..T|
|000004a0| 68 65 20 70 61 72 61 6d | 65 74 65 72 20 63 6f 6e |he param|eter con|
|000004b0| 76 65 6e 74 69 6f 6e 73 | 20 66 6f 72 20 74 68 65 |ventions| for the|
|000004c0| 20 43 20 66 75 6e 63 74 | 69 6f 6e 73 20 61 72 65 | C funct|ions are|
|000004d0| 20 74 72 61 6e 73 6c 61 | 74 65 64 20 74 6f 20 50 | transla|ted to P|
|000004e0| 79 74 68 6f 6e 20 61 73 | 0a 66 6f 6c 6c 6f 77 73 |ython as|.follows|
|000004f0| 3a 0a 0a 3c 50 3e 0a 0a | 3c 55 4c 3e 0a 3c 4c 49 |:..<P>..|<UL>.<LI|
|00000500| 3e 41 6c 6c 20 28 73 68 | 6f 72 74 2c 20 6c 6f 6e |>All (sh|ort, lon|
|00000510| 67 2c 20 75 6e 73 69 67 | 6e 65 64 29 20 69 6e 74 |g, unsig|ned) int|
|00000520| 20 76 61 6c 75 65 73 20 | 61 72 65 20 72 65 70 72 | values |are repr|
|00000530| 65 73 65 6e 74 65 64 20 | 62 79 20 50 79 74 68 6f |esented |by Pytho|
|00000540| 6e 0a 69 6e 74 65 67 65 | 72 73 2e 0a 3c 2f 4c 49 |n.intege|rs..</LI|
|00000550| 3e 0a 3c 4c 49 3e 41 6c | 6c 20 66 6c 6f 61 74 20 |>.<LI>Al|l float |
|00000560| 61 6e 64 20 64 6f 75 62 | 6c 65 20 76 61 6c 75 65 |and doub|le value|
|00000570| 73 20 61 72 65 20 72 65 | 70 72 65 73 65 6e 74 65 |s are re|presente|
|00000580| 64 20 62 79 20 50 79 74 | 68 6f 6e 20 66 6c 6f 61 |d by Pyt|hon floa|
|00000590| 74 69 6e 67 20 70 6f 69 | 6e 74 0a 6e 75 6d 62 65 |ting poi|nt.numbe|
|000005a0| 72 73 2e 0a 49 6e 20 6d | 6f 73 74 20 63 61 73 65 |rs..In m|ost case|
|000005b0| 73 2c 20 50 79 74 68 6f | 6e 20 69 6e 74 65 67 65 |s, Pytho|n intege|
|000005c0| 72 73 20 61 72 65 20 61 | 6c 73 6f 20 61 6c 6c 6f |rs are a|lso allo|
|000005d0| 77 65 64 2e 0a 3c 2f 4c | 49 3e 0a 3c 4c 49 3e 41 |wed..</L|I>.<LI>A|
|000005e0| 6c 6c 20 61 72 72 61 79 | 73 20 61 72 65 20 72 65 |ll array|s are re|
|000005f0| 70 72 65 73 65 6e 74 65 | 64 20 62 79 20 6f 6e 65 |presente|d by one|
|00000600| 2d 64 69 6d 65 6e 73 69 | 6f 6e 61 6c 20 50 79 74 |-dimensi|onal Pyt|
|00000610| 68 6f 6e 20 6c 69 73 74 | 73 2e 0a 49 6e 20 6d 6f |hon list|s..In mo|
|00000620| 73 74 20 63 61 73 65 73 | 2c 20 74 75 70 6c 65 73 |st cases|, tuples|
|00000630| 20 61 72 65 20 61 6c 73 | 6f 20 61 6c 6c 6f 77 65 | are als|o allowe|
|00000640| 64 2e 0a 3c 2f 4c 49 3e | 0a 3c 4c 49 3e 41 6c 6c |d..</LI>|.<LI>All|
|00000650| 20 73 74 72 69 6e 67 20 | 61 6e 64 20 63 68 61 72 | string |and char|
|00000660| 61 63 74 65 72 20 61 72 | 67 75 6d 65 6e 74 73 20 |acter ar|guments |
|00000670| 61 72 65 20 72 65 70 72 | 65 73 65 6e 74 65 64 20 |are repr|esented |
|00000680| 62 79 20 50 79 74 68 6f | 6e 20 73 74 72 69 6e 67 |by Pytho|n string|
|00000690| 73 2c 0a 66 6f 72 20 69 | 6e 73 74 61 6e 63 65 2c |s,.for i|nstance,|
|000006a0| 0a 77 69 6e 6f 70 65 6e | 28 27 48 69 20 54 68 65 |.winopen|('Hi The|
|000006b0| 72 65 21 27 29 0a 61 6e | 64 0a 72 6f 74 61 74 65 |re!').an|d.rotate|
|000006c0| 28 39 30 30 2c 20 27 7a | 27 29 2e 0a 0a 3c 2f 4c |(900, 'z|')...</L|
|000006d0| 49 3e 0a 3c 4c 49 3e 41 | 6c 6c 20 28 73 68 6f 72 |I>.<LI>A|ll (shor|
|000006e0| 74 2c 20 6c 6f 6e 67 2c | 20 75 6e 73 69 67 6e 65 |t, long,| unsigne|
|000006f0| 64 29 20 69 6e 74 65 67 | 65 72 20 61 72 67 75 6d |d) integ|er argum|
|00000700| 65 6e 74 73 20 6f 72 20 | 72 65 74 75 72 6e 20 76 |ents or |return v|
|00000710| 61 6c 75 65 73 20 74 68 | 61 74 20 61 72 65 0a 6f |alues th|at are.o|
|00000720| 6e 6c 79 20 75 73 65 64 | 20 74 6f 20 73 70 65 63 |nly used| to spec|
|00000730| 69 66 79 20 74 68 65 20 | 6c 65 6e 67 74 68 20 6f |ify the |length o|
|00000740| 66 20 61 6e 20 61 72 72 | 61 79 20 61 72 67 75 6d |f an arr|ay argum|
|00000750| 65 6e 74 20 61 72 65 20 | 6f 6d 69 74 74 65 64 2e |ent are |omitted.|
|00000760| 0a 46 6f 72 20 65 78 61 | 6d 70 6c 65 2c 20 74 68 |.For exa|mple, th|
|00000770| 65 20 43 20 63 61 6c 6c | 0a 0a 3c 50 3e 0a 3c 50 |e C call|..<P>.<P|
|00000780| 52 45 3e 0a 6c 6d 64 65 | 66 28 64 65 66 74 79 70 |RE>.lmde|f(deftyp|
|00000790| 65 2c 20 69 6e 64 65 78 | 2c 20 6e 70 2c 20 70 72 |e, index|, np, pr|
|000007a0| 6f 70 73 29 0a 3c 2f 50 | 52 45 3e 0a 0a 3c 50 3e |ops).</P|RE>..<P>|
|000007b0| 0a 69 73 20 74 72 61 6e | 73 6c 61 74 65 64 20 74 |.is tran|slated t|
|000007c0| 6f 20 50 79 74 68 6f 6e | 20 61 73 0a 0a 3c 50 3e |o Python| as..<P>|
|000007d0| 0a 3c 50 52 45 3e 0a 6c | 6d 64 65 66 28 64 65 66 |.<PRE>.l|mdef(def|
|000007e0| 74 79 70 65 2c 20 69 6e | 64 65 78 2c 20 70 72 6f |type, in|dex, pro|
|000007f0| 70 73 29 0a 3c 2f 50 52 | 45 3e 0a 0a 3c 50 3e 0a |ps).</PR|E>..<P>.|
|00000800| 3c 2f 4c 49 3e 0a 3c 4c | 49 3e 4f 75 74 70 75 74 |</LI>.<L|I>Output|
|00000810| 20 61 72 67 75 6d 65 6e | 74 73 20 61 72 65 20 6f | argumen|ts are o|
|00000820| 6d 69 74 74 65 64 20 66 | 72 6f 6d 20 74 68 65 20 |mitted f|rom the |
|00000830| 61 72 67 75 6d 65 6e 74 | 20 6c 69 73 74 3b 20 74 |argument| list; t|
|00000840| 68 65 79 20 61 72 65 0a | 74 72 61 6e 73 6d 69 74 |hey are.|transmit|
|00000850| 74 65 64 20 61 73 20 66 | 75 6e 63 74 69 6f 6e 20 |ted as f|unction |
|00000860| 72 65 74 75 72 6e 20 76 | 61 6c 75 65 73 20 69 6e |return v|alues in|
|00000870| 73 74 65 61 64 2e 0a 49 | 66 20 6d 6f 72 65 20 74 |stead..I|f more t|
|00000880| 68 61 6e 20 6f 6e 65 20 | 76 61 6c 75 65 20 6d 75 |han one |value mu|
|00000890| 73 74 20 62 65 20 72 65 | 74 75 72 6e 65 64 2c 20 |st be re|turned, |
|000008a0| 74 68 65 20 72 65 74 75 | 72 6e 20 76 61 6c 75 65 |the retu|rn value|
|000008b0| 20 69 73 20 61 20 74 75 | 70 6c 65 2e 0a 49 66 20 | is a tu|ple..If |
|000008c0| 74 68 65 20 43 20 66 75 | 6e 63 74 69 6f 6e 20 68 |the C fu|nction h|
|000008d0| 61 73 20 62 6f 74 68 20 | 61 20 72 65 67 75 6c 61 |as both |a regula|
|000008e0| 72 20 72 65 74 75 72 6e | 20 76 61 6c 75 65 20 28 |r return| value (|
|000008f0| 74 68 61 74 20 69 73 20 | 6e 6f 74 20 6f 6d 69 74 |that is |not omit|
|00000900| 74 65 64 0a 62 65 63 61 | 75 73 65 20 6f 66 20 74 |ted.beca|use of t|
|00000910| 68 65 20 70 72 65 76 69 | 6f 75 73 20 72 75 6c 65 |he previ|ous rule|
|00000920| 29 20 61 6e 64 20 61 6e | 20 6f 75 74 70 75 74 20 |) and an| output |
|00000930| 61 72 67 75 6d 65 6e 74 | 2c 20 74 68 65 20 72 65 |argument|, the re|
|00000940| 74 75 72 6e 20 76 61 6c | 75 65 0a 63 6f 6d 65 73 |turn val|ue.comes|
|00000950| 20 66 69 72 73 74 20 69 | 6e 20 74 68 65 20 74 75 | first i|n the tu|
|00000960| 70 6c 65 2e 0a 45 78 61 | 6d 70 6c 65 73 3a 20 74 |ple..Exa|mples: t|
|00000970| 68 65 20 43 20 63 61 6c | 6c 0a 0a 3c 50 3e 0a 3c |he C cal|l..<P>.<|
|00000980| 50 52 45 3e 0a 67 65 74 | 6d 63 6f 6c 6f 72 28 69 |PRE>.get|mcolor(i|
|00000990| 2c 20 26 61 6d 70 3b 72 | 65 64 2c 20 26 61 6d 70 |, &amp;r|ed, &amp|
|000009a0| 3b 67 72 65 65 6e 2c 20 | 26 61 6d 70 3b 62 6c 75 |;green, |&amp;blu|
|000009b0| 65 29 0a 3c 2f 50 52 45 | 3e 0a 0a 3c 50 3e 0a 69 |e).</PRE|>..<P>.i|
|000009c0| 73 20 74 72 61 6e 73 6c | 61 74 65 64 20 74 6f 20 |s transl|ated to |
|000009d0| 50 79 74 68 6f 6e 20 61 | 73 0a 0a 3c 50 3e 0a 3c |Python a|s..<P>.<|
|000009e0| 50 52 45 3e 0a 72 65 64 | 2c 20 67 72 65 65 6e 2c |PRE>.red|, green,|
|000009f0| 20 62 6c 75 65 20 3d 20 | 67 65 74 6d 63 6f 6c 6f | blue = |getmcolo|
|00000a00| 72 28 69 29 0a 3c 2f 50 | 52 45 3e 0a 0a 3c 50 3e |r(i).</P|RE>..<P>|
|00000a10| 0a 3c 2f 4c 49 3e 0a 3c | 2f 55 4c 3e 0a 0a 3c 50 |.</LI>.<|/UL>..<P|
|00000a20| 3e 0a 54 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |>.The fo|llowing |
|00000a30| 66 75 6e 63 74 69 6f 6e | 73 20 61 72 65 20 6e 6f |function|s are no|
|00000a40| 6e 2d 73 74 61 6e 64 61 | 72 64 20 6f 72 20 68 61 |n-standa|rd or ha|
|00000a50| 76 65 20 73 70 65 63 69 | 61 6c 20 61 72 67 75 6d |ve speci|al argum|
|00000a60| 65 6e 74 0a 63 6f 6e 76 | 65 6e 74 69 6f 6e 73 3a |ent.conv|entions:|
|00000a70| 0a 0a 3c 50 3e 0a 0a 3c | 42 52 3e 0a 3c 49 4d 47 |..<P>..<|BR>.<IMG|
|00000a80| 0a 20 20 53 54 59 4c 45 | 3d 22 68 65 69 67 68 74 |. STYLE|="height|
|00000a90| 3a 20 31 39 36 2e 32 35 | 65 78 3b 20 76 65 72 74 |: 196.25|ex; vert|
|00000aa0| 69 63 61 6c 2d 61 6c 69 | 67 6e 3a 20 2d 30 2e 37 |ical-ali|gn: -0.7|
|00000ab0| 30 65 78 3b 20 22 20 53 | 52 43 3d 22 69 6d 67 31 |0ex; " S|RC="img1|
|00000ac0| 2e 70 6e 67 22 0a 20 41 | 4c 54 3d 22 5c 62 65 67 |.png". A|LT="\beg|
|00000ad0| 69 6e 7b 66 75 6e 63 64 | 65 73 63 7d 7b 76 61 72 |in{funcd|esc}{var|
|00000ae0| 72 61 79 7d 7b 61 72 67 | 75 6d 65 6e 74 7d 0a 45 |ray}{arg|ument}.E|
|00000af0| 71 75 69 76 61 6c 65 6e | 74 20 74 6f 20 62 75 74 |quivalen|t to but|
|00000b00| 20 66 61 73 74 65 72 20 | 74 68 61 6e 20 61 20 6e | faster |than a n|
|00000b10| 75 6d 62 65 72 20 6f 66 | 0a 5c 63 6f 2e 2e 2e 0a |umber of|.\co....|
|00000b20| 2e 2e 2e 61 74 65 64 20 | 69 6e 20 74 68 65 20 6d |...ated |in the m|
|00000b30| 61 6e 20 70 61 67 65 29 | 2c 0a 61 6e 64 20 66 6f |an page)|,.and fo|
|00000b40| 72 20 65 61 63 68 20 70 | 6f 69 6e 74 0a 5c 63 6f |r each p|oint.\co|
|00000b50| 64 65 7b 76 33 64 28 29 | 7d 0a 69 73 20 63 61 6c |de{v3d()|}.is cal|
|00000b60| 6c 65 64 2e 0a 5c 65 6e | 64 7b 66 75 6e 63 64 65 |led..\en|d{funcde|
|00000b70| 73 63 7d 22 3e 0a 3c 42 | 52 3e 0a 0a 3c 50 3e 0a |sc}">.<B|R>..<P>.|
|00000b80| 3c 42 52 3e 0a 3c 49 4d | 47 0a 20 20 53 54 59 4c |<BR>.<IM|G. STYL|
|00000b90| 45 3d 22 68 65 69 67 68 | 74 3a 20 32 2e 33 38 65 |E="heigh|t: 2.38e|
|00000ba0| 78 3b 20 76 65 72 74 69 | 63 61 6c 2d 61 6c 69 67 |x; verti|cal-alig|
|00000bb0| 6e 3a 20 31 37 36 2e 32 | 37 65 78 3b 20 22 20 53 |n: 176.2|7ex; " S|
|00000bc0| 52 43 3d 22 69 6d 67 32 | 2e 70 6e 67 22 0a 20 41 |RC="img2|.png". A|
|00000bd0| 4c 54 3d 22 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |LT="\beg|in{funcd|
|00000be0| 65 73 63 7d 7b 6e 76 61 | 72 72 61 79 7d 7b 7d 0a |esc}{nva|rray}{}.|
|00000bf0| 45 71 75 69 76 61 6c 65 | 6e 74 20 74 6f 20 62 75 |Equivale|nt to bu|
|00000c00| 74 20 66 61 73 74 65 72 | 20 74 68 61 6e 20 61 20 |t faster| than a |
|00000c10| 6e 75 6d 62 65 72 20 6f | 66 0a 5c 63 6f 64 65 7b |number o|f.\code{|
|00000c20| 6e 33 66 7d 2e 2e 2e 0a | 2e 2e 2e 65 64 20 66 6f |n3f}....|...ed fo|
|00000c30| 72 20 74 68 65 20 6e 6f | 72 6d 61 6c 2c 20 61 6e |r the no|rmal, an|
|00000c40| 64 20 74 68 65 6e 0a 5c | 63 6f 64 65 7b 76 33 66 |d then.\|code{v3f|
|00000c50| 28 29 7d 0a 69 73 20 63 | 61 6c 6c 65 64 20 66 6f |()}.is c|alled fo|
|00000c60| 72 20 74 68 65 20 70 6f | 69 6e 74 2e 0a 5c 65 6e |r the po|int..\en|
|00000c70| 64 7b 66 75 6e 63 64 65 | 73 63 7d 22 3e 0a 3c 42 |d{funcde|sc}">.<B|
|00000c80| 52 3e 0a 0a 3c 50 3e 0a | 3c 42 52 3e 0a 3c 49 4d |R>..<P>.|<BR>.<IM|
|00000c90| 47 0a 20 20 53 54 59 4c | 45 3d 22 68 65 69 67 68 |G. STYL|E="heigh|
|00000ca0| 74 3a 20 32 2e 33 38 65 | 78 3b 20 76 65 72 74 69 |t: 2.38e|x; verti|
|00000cb0| 63 61 6c 2d 61 6c 69 67 | 6e 3a 20 31 37 36 2e 32 |cal-alig|n: 176.2|
|00000cc0| 37 65 78 3b 20 22 20 53 | 52 43 3d 22 69 6d 67 33 |7ex; " S|RC="img3|
|00000cd0| 2e 70 6e 67 22 0a 20 41 | 4c 54 3d 22 5c 62 65 67 |.png". A|LT="\beg|
|00000ce0| 69 6e 7b 66 75 6e 63 64 | 65 73 63 7d 7b 76 6e 61 |in{funcd|esc}{vna|
|00000cf0| 72 72 61 79 7d 7b 7d 0a | 53 69 6d 69 6c 61 72 20 |rray}{}.|Similar |
|00000d00| 74 6f 0a 5c 63 6f 64 65 | 7b 6e 76 61 72 72 61 79 |to.\code|{nvarray|
|00000d10| 28 29 7d 0a 62 75 74 20 | 74 68 65 20 70 61 69 72 |()}.but |the pair|
|00000d20| 73 20 68 61 76 65 20 74 | 68 65 20 70 6f 69 6e 74 |s have t|he point|
|00000d30| 20 66 69 72 73 74 20 61 | 6e 64 20 74 68 65 20 6e | first a|nd the n|
|00000d40| 6f 72 6d 61 6c 20 73 65 | 63 6f 6e 64 2e 0a 5c 65 |ormal se|cond..\e|
|00000d50| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 22 3e 0a 3c |nd{funcd|esc}">.<|
|00000d60| 42 52 3e 0a 0a 3c 50 3e | 0a 3c 42 52 3e 0a 3c 49 |BR>..<P>|.<BR>.<I|
|00000d70| 4d 47 0a 20 20 53 54 59 | 4c 45 3d 22 68 65 69 67 |MG. STY|LE="heig|
|00000d80| 68 74 3a 20 32 2e 33 38 | 65 78 3b 20 76 65 72 74 |ht: 2.38|ex; vert|
|00000d90| 69 63 61 6c 2d 61 6c 69 | 67 6e 3a 20 31 37 36 2e |ical-ali|gn: 176.|
|00000da0| 32 37 65 78 3b 20 22 20 | 53 52 43 3d 22 69 6d 67 |27ex; " |SRC="img|
|00000db0| 34 2e 70 6e 67 22 0a 20 | 41 4c 54 3d 22 5c 62 65 |4.png". |ALT="\be|
|00000dc0| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 6e 75 |gin{func|desc}{nu|
|00000dd0| 72 62 73 73 75 72 66 61 | 63 65 7d 7b 73 5f 6b 5c |rbssurfa|ce}{s_k\|
|00000de0| 2c 20 74 5f 6b 5c 2c 20 | 63 74 6c 5c 2c 20 73 5f |, t_k\, |ctl\, s_|
|00000df0| 6f 72 64 5c 2c 20 74 5f | 6f 72 64 5c 2c 20 74 79 |ord\, t_|ord\, ty|
|00000e00| 70 65 7d 0a 44 65 66 69 | 6e 65 73 20 61 2e 2e 2e |pe}.Defi|nes a...|
|00000e10| 0a 2e 2e 2e 76 61 72 7b | 73 5f 6b 7d 29 20 2d 20 |....var{|s_k}) - |
|00000e20| 5c 76 61 72 7b 73 5f 6f | 72 64 7d 5d 7d 2c 0a 5c |\var{s_o|rd}]},.\|
|00000e30| 63 6f 64 65 7b 5b 6c 65 | 6e 28 5c 76 61 72 7b 74 |code{[le|n(\var{t|
|00000e40| 5f 6b 7d 29 20 2d 20 5c | 76 61 72 7b 74 5f 6f 72 |_k}) - \|var{t_or|
|00000e50| 64 7d 5d 7d 2e 0a 5c 65 | 6e 64 7b 66 75 6e 63 64 |d}]}..\e|nd{funcd|
|00000e60| 65 73 63 7d 22 3e 0a 3c | 42 52 3e 0a 0a 3c 50 3e |esc}">.<|BR>..<P>|
|00000e70| 0a 3c 42 52 3e 0a 3c 49 | 4d 47 0a 20 20 53 54 59 |.<BR>.<I|MG. STY|
|00000e80| 4c 45 3d 22 68 65 69 67 | 68 74 3a 20 32 2e 33 38 |LE="heig|ht: 2.38|
|00000e90| 65 78 3b 20 76 65 72 74 | 69 63 61 6c 2d 61 6c 69 |ex; vert|ical-ali|
|00000ea0| 67 6e 3a 20 31 37 36 2e | 32 37 65 78 3b 20 22 20 |gn: 176.|27ex; " |
|00000eb0| 53 52 43 3d 22 69 6d 67 | 35 2e 70 6e 67 22 0a 20 |SRC="img|5.png". |
|00000ec0| 41 4c 54 3d 22 5c 62 65 | 67 69 6e 7b 66 75 6e 63 |ALT="\be|gin{func|
|00000ed0| 64 65 73 63 7d 7b 6e 75 | 72 62 73 63 75 72 76 65 |desc}{nu|rbscurve|
|00000ee0| 7d 7b 6b 6e 6f 74 73 5c | 2c 20 63 74 6c 70 6f 69 |}{knots\|, ctlpoi|
|00000ef0| 6e 74 73 5c 2c 20 6f 72 | 64 65 72 5c 2c 20 74 79 |nts\, or|der\, ty|
|00000f00| 70 65 7d 0a 44 65 66 69 | 6e 65 73 20 61 20 6e 75 |pe}.Defi|nes a nu|
|00000f10| 72 62 73 20 63 2e 2e 2e | 0a 2e 2e 2e 54 68 65 20 |rbs c...|....The |
|00000f20| 6c 65 6e 67 74 68 20 6f | 66 20 63 74 6c 70 6f 69 |length o|f ctlpoi|
|00000f30| 6e 74 73 20 69 73 0a 5c | 63 6f 64 65 7b 6c 65 6e |nts is.\|code{len|
|00000f40| 28 5c 76 61 72 7b 6b 6e | 6f 74 73 7d 29 20 2d 20 |(\var{kn|ots}) - |
|00000f50| 5c 76 61 72 7b 6f 72 64 | 65 72 7d 7d 2e 0a 5c 65 |\var{ord|er}}..\e|
|00000f60| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 22 3e 0a 3c |nd{funcd|esc}">.<|
|00000f70| 42 52 3e 0a 0a 3c 50 3e | 0a 3c 42 52 3e 0a 3c 49 |BR>..<P>|.<BR>.<I|
|00000f80| 4d 47 0a 20 20 53 54 59 | 4c 45 3d 22 68 65 69 67 |MG. STY|LE="heig|
|00000f90| 68 74 3a 20 32 2e 33 38 | 65 78 3b 20 76 65 72 74 |ht: 2.38|ex; vert|
|00000fa0| 69 63 61 6c 2d 61 6c 69 | 67 6e 3a 20 31 37 36 2e |ical-ali|gn: 176.|
|00000fb0| 34 30 65 78 3b 20 22 20 | 53 52 43 3d 22 69 6d 67 |40ex; " |SRC="img|
|00000fc0| 36 2e 70 6e 67 22 0a 20 | 41 4c 54 3d 22 5c 62 65 |6.png". |ALT="\be|
|00000fd0| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 70 77 |gin{func|desc}{pw|
|00000fe0| 6c 63 75 72 76 65 7d 7b | 70 6f 69 6e 74 73 5c 2c |lcurve}{|points\,|
|00000ff0| 20 74 79 70 65 7d 0a 44 | 65 66 69 6e 65 73 20 61 | type}.D|efines a|
|00001000| 20 70 69 65 63 65 77 69 | 73 65 2d 6c 69 6e 65 61 | piecewi|se-linea|
|00001010| 72 20 63 75 72 76 65 2e | 0a 5c 76 61 72 7b 70 6f |r curve.|.\var{po|
|00001020| 69 6e 74 73 7d 0a 69 73 | 20 61 20 6c 69 73 74 20 |ints}.is| a list |
|00001030| 6f 66 20 70 6f 69 6e 74 | 73 2e 0a 5c 76 61 72 7b |of point|s..\var{|
|00001040| 74 79 70 65 7d 0a 6d 75 | 73 74 20 62 65 0a 5c 63 |type}.mu|st be.\c|
|00001050| 6f 64 65 7b 4e 5f 53 54 | 7d 2e 0a 5c 65 6e 64 7b |ode{N_ST|}..\end{|
|00001060| 66 75 6e 63 64 65 73 63 | 7d 22 3e 0a 3c 42 52 3e |funcdesc|}">.<BR>|
|00001070| 0a 0a 3c 50 3e 0a 3c 42 | 52 3e 0a 3c 49 4d 47 0a |..<P>.<B|R>.<IMG.|
|00001080| 20 20 53 54 59 4c 45 3d | 22 68 65 69 67 68 74 3a | STYLE=|"height:|
|00001090| 20 32 2e 31 37 65 78 3b | 20 76 65 72 74 69 63 61 | 2.17ex;| vertica|
|000010a0| 6c 2d 61 6c 69 67 6e 3a | 20 31 37 36 2e 36 38 65 |l-align:| 176.68e|
|000010b0| 78 3b 20 22 20 53 52 43 | 3d 22 69 6d 67 37 2e 70 |x; " SRC|="img7.p|
|000010c0| 6e 67 22 0a 20 41 4c 54 | 3d 22 5c 62 65 67 69 6e |ng". ALT|="\begin|
|000010d0| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 70 69 63 6b 7d |{funcdes|c}{pick}|
|000010e0| 7b 6e 7d 0a 5c 66 75 6e | 63 6c 69 6e 65 7b 73 65 |{n}.\fun|cline{se|
|000010f0| 6c 65 63 74 7d 7b 6e 7d | 0a 54 68 65 20 6f 6e 6c |lect}{n}|.The onl|
|00001100| 79 20 61 72 67 75 6d 65 | 6e 74 20 74 6f 20 74 68 |y argume|nt to th|
|00001110| 65 73 65 20 66 75 6e 63 | 74 69 6f 6e 73 20 73 70 |ese func|tions sp|
|00001120| 65 63 69 66 69 65 73 20 | 74 68 65 20 64 65 73 69 |ecifies |the desi|
|00001130| 72 65 64 20 73 69 7a 65 | 20 6f 66 20 74 68 65 0a |red size| of the.|
|00001140| 70 69 63 6b 20 6f 72 20 | 73 65 6c 65 63 74 20 62 |pick or |select b|
|00001150| 75 66 66 65 72 2e 0a 5c | 65 6e 64 7b 66 75 6e 63 |uffer..\|end{func|
|00001160| 64 65 73 63 7d 22 3e 0a | 3c 42 52 3e 0a 0a 3c 50 |desc}">.|<BR>..<P|
|00001170| 3e 0a 3c 42 52 3e 0a 3c | 49 4d 47 0a 20 20 53 54 |>.<BR>.<|IMG. ST|
|00001180| 59 4c 45 3d 22 68 65 69 | 67 68 74 3a 20 32 2e 31 |YLE="hei|ght: 2.1|
|00001190| 37 65 78 3b 20 76 65 72 | 74 69 63 61 6c 2d 61 6c |7ex; ver|tical-al|
|000011a0| 69 67 6e 3a 20 31 37 36 | 2e 35 35 65 78 3b 20 22 |ign: 176|.55ex; "|
|000011b0| 20 53 52 43 3d 22 69 6d | 67 38 2e 70 6e 67 22 0a | SRC="im|g8.png".|
|000011c0| 20 41 4c 54 3d 22 5c 62 | 65 67 69 6e 7b 66 75 6e | ALT="\b|egin{fun|
|000011d0| 63 64 65 73 63 7d 7b 65 | 6e 64 70 69 63 6b 7d 7b |cdesc}{e|ndpick}{|
|000011e0| 7d 0a 5c 66 75 6e 63 6c | 69 6e 65 7b 65 6e 64 73 |}.\funcl|ine{ends|
|000011f0| 65 6c 65 63 74 7d 7b 7d | 0a 54 68 65 73 65 20 66 |elect}{}|.These f|
|00001200| 75 6e 63 74 69 6f 6e 73 | 20 68 61 76 65 20 6e 6f |unctions| have no|
|00001210| 20 61 72 67 75 6d 2e 2e | 2e 0a 2e 2e 2e 63 6b 2f | argum..|.....ck/|
|00001220| 73 65 6c 65 63 74 20 62 | 75 66 66 65 72 2e 0a 4e |select b|uffer..N|
|00001230| 6f 20 6d 65 74 68 6f 64 | 20 69 73 20 70 72 6f 76 |o method| is prov|
|00001240| 69 64 65 64 20 74 6f 20 | 64 65 74 65 63 74 20 62 |ided to |detect b|
|00001250| 75 66 66 65 72 20 6f 76 | 65 72 72 75 6e 2e 0a 5c |uffer ov|errun..\|
|00001260| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 22 3e 0a |end{func|desc}">.|
|00001270| 3c 42 52 3e 0a 0a 3c 50 | 3e 0a 48 65 72 65 20 69 |<BR>..<P|>.Here i|
|00001280| 73 20 61 20 74 69 6e 79 | 20 62 75 74 20 63 6f 6d |s a tiny| but com|
|00001290| 70 6c 65 74 65 20 65 78 | 61 6d 70 6c 65 20 47 4c |plete ex|ample GL|
|000012a0| 20 70 72 6f 67 72 61 6d | 20 69 6e 20 50 79 74 68 | program| in Pyth|
|000012b0| 6f 6e 3a 0a 0a 3c 50 3e | 0a 3c 50 52 45 3e 0a 69 |on:..<P>|.<PRE>.i|
|000012c0| 6d 70 6f 72 74 20 67 6c | 2c 20 47 4c 2c 20 74 69 |mport gl|, GL, ti|
|000012d0| 6d 65 0a 0a 64 65 66 20 | 6d 61 69 6e 28 29 3a 0a |me..def |main():.|
|000012e0| 20 20 20 20 67 6c 2e 66 | 6f 72 65 67 72 6f 75 6e | gl.f|oregroun|
|000012f0| 64 28 29 0a 20 20 20 20 | 67 6c 2e 70 72 65 66 70 |d(). |gl.prefp|
|00001300| 6f 73 69 74 69 6f 6e 28 | 35 30 30 2c 20 39 30 30 |osition(|500, 900|
|00001310| 2c 20 35 30 30 2c 20 39 | 30 30 29 0a 20 20 20 20 |, 500, 9|00). |
|00001320| 77 20 3d 20 67 6c 2e 77 | 69 6e 6f 70 65 6e 28 27 |w = gl.w|inopen('|
|00001330| 43 72 69 73 73 43 72 6f | 73 73 27 29 0a 20 20 20 |CrissCro|ss'). |
|00001340| 20 67 6c 2e 6f 72 74 68 | 6f 32 28 30 2e 30 2c 20 | gl.orth|o2(0.0, |
|00001350| 34 30 30 2e 30 2c 20 30 | 2e 30 2c 20 34 30 30 2e |400.0, 0|.0, 400.|
|00001360| 30 29 0a 20 20 20 20 67 | 6c 2e 63 6f 6c 6f 72 28 |0). g|l.color(|
|00001370| 47 4c 2e 57 48 49 54 45 | 29 0a 20 20 20 20 67 6c |GL.WHITE|). gl|
|00001380| 2e 63 6c 65 61 72 28 29 | 0a 20 20 20 20 67 6c 2e |.clear()|. gl.|
|00001390| 63 6f 6c 6f 72 28 47 4c | 2e 52 45 44 29 0a 20 20 |color(GL|.RED). |
|000013a0| 20 20 67 6c 2e 62 67 6e | 6c 69 6e 65 28 29 0a 20 | gl.bgn|line(). |
|000013b0| 20 20 20 67 6c 2e 76 32 | 66 28 30 2e 30 2c 20 30 | gl.v2|f(0.0, 0|
|000013c0| 2e 30 29 0a 20 20 20 20 | 67 6c 2e 76 32 66 28 34 |.0). |gl.v2f(4|
|000013d0| 30 30 2e 30 2c 20 34 30 | 30 2e 30 29 0a 20 20 20 |00.0, 40|0.0). |
|000013e0| 20 67 6c 2e 65 6e 64 6c | 69 6e 65 28 29 0a 20 20 | gl.endl|ine(). |
|000013f0| 20 20 67 6c 2e 62 67 6e | 6c 69 6e 65 28 29 0a 20 | gl.bgn|line(). |
|00001400| 20 20 20 67 6c 2e 76 32 | 66 28 34 30 30 2e 30 2c | gl.v2|f(400.0,|
|00001410| 20 30 2e 30 29 0a 20 20 | 20 20 67 6c 2e 76 32 66 | 0.0). | gl.v2f|
|00001420| 28 30 2e 30 2c 20 34 30 | 30 2e 30 29 0a 20 20 20 |(0.0, 40|0.0). |
|00001430| 20 67 6c 2e 65 6e 64 6c | 69 6e 65 28 29 0a 20 20 | gl.endl|ine(). |
|00001440| 20 20 74 69 6d 65 2e 73 | 6c 65 65 70 28 35 29 0a | time.s|leep(5).|
|00001450| 0a 6d 61 69 6e 28 29 0a | 3c 2f 50 52 45 3e 0a 0a |.main().|</PRE>..|
|00001460| 3c 50 3e 0a 0a 3c 48 52 | 3e 0a 0a 3c 2f 42 4f 44 |<P>..<HR|>..</BOD|
|00001470| 59 3e 0a 3c 2f 48 54 4d | 4c 3e 0a |Y>.</HTM|L>. |
+--------+-------------------------+-------------------------+--------+--------+