Changes

Jump to: navigation, search

Graphics Programming

13,466 bytes added, 16:57, 26 May 2018
Created page with "'''Home * Programming * Graphics Programming''' '''Graphics Programming''' in computer chess is essentially about drawing chess positions..."
'''[[Main Page|Home]] * [[Programming]] * Graphics Programming'''

'''Graphics Programming''' in computer chess is essentially about drawing [[Chess Position|chess positions]] or [[Chess Diagram|diagrams]] within a [[User Interface|user interface]] to give [https://en.wikipedia.org/wiki/User_%28computing%29 users] a visual [https://en.wikipedia.org/wiki/Feedback feedback] of the game state, while [https://en.wikipedia.org/wiki/Human%E2%80%93computer_interaction interacting] with the program.

=Visualization=
* [[2D Graphics Board]]
* [[3D Graphics Board]]
<span id="ASCIIDiagrams"></span>
=Pseudo Graphics=
==ASCII Diagrams==
ASCII Diagrams on [https://en.wikipedia.org/wiki/Teleprinter teleprinters] were already used by early programs, such as [[The Bernstein Chess Program]], and are still appropriate today for a rudimentary text oriented [[CLI|command line]] [[User Interface|user interface]], to display a position on a [https://en.wikipedia.org/wiki/Computer_terminal terminal] with [https://en.wikipedia.org/wiki/Monospaced_font monospaced] [https://en.wikipedia.org/wiki/ASCII ASCII] [https://en.wikipedia.org/wiki/Character_%28computing%29 characters]. One may further store the characters inside "''[https://en.wikipedia.org/wiki/Human-readable_medium human readable]''" [https://en.wikipedia.org/wiki/Text_file#ASCII ASCII files] for [[Logging|logging-]] or [[Debugging|debugging]] purposes. Several proposals to display an ASCII board were made in [[CCC]] <ref>[https://www.stmintz.com/ccc/index.php?id=113510 ASCII chess boards] by [[Steffen A. Jakob|Steffen Jakob]], [[CCC]], June 05, 2000</ref> <ref>[https://www.stmintz.com/ccc/index.php?id=334290 ASCII Board representation] by [[Andreas Guettinger]], [[CCC]], December 08, 2003</ref> . [[Ernst A. Heinz]] came up with the left one <ref>[https://www.stmintz.com/ccc/index.php?id=113544 Re: ASCII chess boards] by [[Ernst A. Heinz]], [[CCC]], June 05, 2000</ref> , [[Reinhard Scharnagl]] proposed the right one with the remarks below <ref>[https://www.stmintz.com/ccc/index.php?id=334328 Re: ASCII Board representation] by [[Reinhard Scharnagl]], [[CCC]], December 08, 2003</ref> :
<pre>
kqKQ -
+------------------------+ +-*--b--c--d--*--f--g--*-+
8 |*R *N:*B *Q:*K *B:*N *R:| 8 |[r][n][b][q][k][b][n][r]|
7 |*P:*P *P:*P *P:*P *P:*P | 7 |[p][p][p][p][p][p][p][p]|
6 | ::: ::: ::: :::| 6 | ::: ::: ::: :::|
5 |::: ::: ::: ::: | 5 |::: ::: ::: ::: |
4 | ::: ::: ::: :::| 4 | ::: ::: ::: :::|
3 |::: ::: ::: ::: | 3 |::: ::: ::: ::: |
2 | P :P: P :P: P :P: P :P:| 2 |<P><P><P><P><P><P><P><P>|
1 |:R: N :B: Q :K: B :N: R | 1 |<R><N><B><Q><K><B><N><R>|
+------------------------+ =>+-*--b--c--d--*--f--g--*-+
a b c d e f g h

Remarks:
a) with "*" is shown, where castling potential resides (FRC specific)
b) with "=>" is shown, which side has to move
</pre>
<span id="Semigraphics"></span>
==Semigraphics==
Some of the early [https://en.wikipedia.org/wiki/Home_computer home computers] had semigraphics characters and [https://en.wikipedia.org/wiki/Sprite_%28computer_graphics%29 sprites] <ref>[https://en.wikipedia.org/wiki/List_of_home_computers_by_video_hardware List of home computers by video hardware from Wikipedia]</ref> for a more realistic board representation of chess programs.
[[FILE:Microchess-1-5-trs80-screenshot.l062302023.jennings.jpg|none|border|text-bottom|640px|link=http://www.computerhistory.org/chess/full_record.php?iid=stl-431e1a080c29f]]
[[MicroChess]] Screen on [[TRS-80]], 1976 <ref>[http://www.computerhistory.org/chess/full_record.php?iid=stl-431e1a080c29f Microchess 1.5 running on a Radio Shack TRS-80 microcomputer], 1976, Courtesy of [[Peter Jennings]], [[The Computer History Museum]]</ref>

=High Resolution Graphics=
Next generation [https://en.wikipedia.org/wiki/Home_computer home-] and [https://en.wikipedia.org/wiki/Personal_computer personal computers] already did support not only [https://en.wikipedia.org/wiki/Text_mode text mode] and semigraphics, but [https://en.wikipedia.org/wiki/Computer_graphics graphic] modes for [https://en.wikipedia.org/wiki/Graphic_display_resolutions resolutions] supported by the [https://en.wikipedia.org/wiki/Computer_monitor computer monitor] and its [https://en.wikipedia.org/wiki/Video_card video controller]. A [https://en.wikipedia.org/wiki/System_call system call] was necessary to switch the video card into a mode, where each [https://en.wikipedia.org/wiki/Pixel pixel] was an element of an [[Array|array]] [https://en.wikipedia.org/wiki/Memory-mapped_I/O mapped] into the [[Memory|main memory]], either [[Bit|bit-wise]] for [https://en.wikipedia.org/wiki/Black-and-white black-and-white] or [[Nibble|nibble-]], [[Byte|byte-]] or [[Word|word-wise]] for sixteen, 256 or more colors or [https://en.wikipedia.org/wiki/Grayscale grayscale].

==DOS Area==
Programs running under [[MS-DOS]] on [[IBM PC|IBM PCs]], initially using a [https://en.wikipedia.org/wiki/Color_Graphics_Adapter color graphics adapter] (CGA), and later [https://en.wikipedia.org/wiki/Hercules_Graphics_Card Hercules graphics cards] and [https://en.wikipedia.org/wiki/Video_Graphics_Array video graphics array] (VGA), needed to use a [https://en.wikipedia.org/wiki/BIOS_interrupt_call BIOS interrupt call], the [https://en.wikipedia.org/wiki/INT_10H INT 10H], to switch graphic modes accordantly to make [https://en.wikipedia.org/wiki/All_Points_Addressable all points addressable]. Chess programs usually worked in [https://en.wikipedia.org/wiki/Fullscreen fullscreen] mode at that times on single tasking operating systems, the program run exclusively and could access whole the hardware and memory. A VGA [https://en.wikipedia.org/wiki/Display_resolution resolution] of 640x480 was quite sufficient for drawing an ergonomic chess board in [[2D Graphics Board|2D]] or even [[3D Graphics Board|3D]].

==Abstraction==
With the advent of [https://en.wikipedia.org/wiki/Computer_multitasking multitasking] operating systems with [https://en.wikipedia.org/wiki/Memory_protection memory protection] between [[Process|processes]] and a [https://en.wikipedia.org/wiki/Ring_%28computer_security%29 protection ring model], and their [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] and window managers, direct access was no longer possible, and video hardware became abstract, accessible via [https://en.wikipedia.org/wiki/Application_programming_interface API-calls] of kernel- or [https://en.wikipedia.org/wiki/Graphics_library graphic libraries] or toolkits.

==Screenshots==
[[FILE:275507-psion-chess-atari-st-screenshot-information-window-colour.png|none|border|text-bottom|640px|link=http://www.mobygames.com/game/psion-chess/screenshots]]
[[Psion]] for [[Atari ST]] <ref>[http://www.mobygames.com/game/psion-chess/screenshots Psion Chess screenshots] from [https://en.wikipedia.org/wiki/MobyGames MobyGames]</ref>

=See also=
* [[Chess Position]]
* [[Extended Position Description]] (EPD)
* [[Algebraic Chess Notation#FAN|Figurine Algebraic Notation]] (FAN)
* [[Forsyth-Edwards Notation]] (FEN)
* [[GPU]]
* [[GUI]]

=Publications=
* [[Kathe Spracklen]] ('''1979'''). ''Micro Graphics and X-Y Plotter''. [[Personal Computing#3_2|Personal Computing, Vol. 3, No. 2]], pp. 75
* [[Alexander G. M. Smith]] ('''1991'''). ''[http://web.ncf.ca/au829/Handyman/Thesis.html Handyman - A Multiuser Puppeteering System for Computer Graphics Motion Control]''. Masters thesis, [https://en.wikipedia.org/wiki/Carleton_University Carleton University]
* [[Oliver Vornberger]] ('''2006'''). ''[http://www-lehre.inf.uos.de/%7Ecg/2006/skript/skript.html Computergrafik]''. [http://www-lehre.inf.uos.de/%7Ecg/2006/PDF/skript.pdf pdf] (German)
* [[Leen Ammeraal]] and [http://www.utdallas.edu/~kzhang/ Kang Zhang] ('''2007'''). ''[http://home.planet.nl/%7Eammeraal/grjava2e.html Computer Graphics for Java Programmers, 2nd Edition]'', ISBN-13: 978-0-470-03160-5 / ISBN-10: 0-470-03160-3 by [http://eu.wiley.com/WileyCDA/Section/id-300022.html John Wiley]
* [http://goossens.web.cern.ch/goossens/ Michel Goossens], [http://www.informit.com/authors/bio.aspx?a=A2624A62-C2B4-40F9-B8ED-E99563F89A27 Frank Mittelbach], [http://users.ox.ac.uk/~rahtz/ Sebastian Rahtz], [http://www.loria.fr/~roegel/ Denis Roegel], [http://www.uit.co.uk/Authors/HerbVoss Herbert Voß] ('''2007'''). ''[http://xml.web.cern.ch/XML/lgc2/ The LATEXGraphics Companion]''. Second Edition, Addison-Wesley, ISBN-13: 978-0-321-50892-8, [http://ptgmedia.pearsoncmg.com/images/9780321508928/samplepages/0321508920_Sample.pdf sample pdf], 10.1 Chess, 10.2 Xiangqi—Chinese Chess <ref>[https://en.wikipedia.org/wiki/LaTeX LaTeX from Wikipedia]</ref>
* [https://en.wikipedia.org/wiki/Eric_Lengyel Eric Lengye] ('''2011'''). ''[http://www.mathfor3dgameprogramming.com/ Mathematics for 3D Game Programming and Computer Graphics, Third Edition]''. ISBN-13: 978-1435458864, [http://www.amazon.com/exec/obidos/tg/detail/-/1435458869 amazon.com]

=Forum Posts=
* [https://www.stmintz.com/ccc/index.php?id=113510 ASCII chess boards] by [[Steffen A. Jakob|Steffen Jakob]], [[CCC]], June 05, 2000
* [https://www.stmintz.com/ccc/index.php?id=334290 ASCII Board representation] by [[Andreas Guettinger]], [[CCC]], December 08, 2003
* [http://www.talkchess.com/forum/viewtopic.php?start=0&t=27853 How to place a chess piece on a bmp square ?] by [[Matthias Gemuh]], [[CCC]], May 11, 2009
* [http://www.open-aurec.com/wbforum/viewtopic.php?f=4&t=51798#p196372 Re: piece bitmaps - how to get a transparent background] by [[Harm Geert Muller|H.G.Muller]], [[Computer Chess Forums|Winboard Programming Forum]], May 23, 2011

=External Links=
* [http://commons.wikimedia.org/wiki/Category:Chess_bitmap_pieces Category:Chess bitmap pieces - Wikimedia Commons]
* [http://www.enpassant.dk/chess/grafeng.htm Chess Graphics] from [http://www.enpassant.dk/chess/homeeng.htm En Passant - Nørresundby Chess Club]

==Algorithms==
{{Graphic Algorithms}}
==[https://en.wikipedia.org/wiki/Coordinate_system Coordinates]==
* [https://en.wikipedia.org/wiki/Coordinate_system Coordinate system from Wikipedia]
: [https://en.wikipedia.org/wiki/Cartesian_coordinate_system Cartesian coordinate system]
: [https://en.wikipedia.org/wiki/Curvilinear_coordinates Curvilinear coordinates]
* [https://en.wikipedia.org/wiki/Coordinate_rotations_and_reflections Coordinate rotations and reflections from Wikipedia]
* [https://en.wikipedia.org/wiki/Euclidean_space Euclidean space from Wikipedia]
* [https://en.wikipedia.org/wiki/List_of_common_coordinate_transformations List of common coordinate transformations from Wikipedia]
* [https://en.wikipedia.org/wiki/Orthogonal_group Orthogonal group from Wikipedia]
* [https://en.wikipedia.org/wiki/Transformation_%28function%29 Transformation (function) from Wikipedia]
: [https://en.wikipedia.org/wiki/Reflection_%28mathematics%29 Reflection (mathematics)]
: [https://en.wikipedia.org/wiki/Rotation_%28mathematics%29 Rotation (mathematics)]
: [https://en.wikipedia.org/wiki/Rotation_matrix Rotation matrix]
: [https://en.wikipedia.org/wiki/Transformation_matrix Transformation matrix]
: [https://en.wikipedia.org/wiki/Translation_%28geometry%29 Translation (geometry)]

==[https://en.wikipedia.org/wiki/Geometric_primitive Geometric primitives]==
* [https://en.wikipedia.org/wiki/Arc_%28geometry%29 Arc (geometry) from Wikipedia]
* [https://en.wikipedia.org/wiki/B-spline B-spline from Wikipedia]
* [https://en.wikipedia.org/wiki/Bitmap Bitmap from Wikipedia]
* [https://en.wikipedia.org/wiki/B%C3%A9zier_curve Bézier curve from Wikipedia]
* [https://en.wikipedia.org/wiki/Circle Circle from Wikipedia]
* [https://en.wikipedia.org/wiki/Ellipse Ellipse from Wikipedia]
* [https://en.wikipedia.org/wiki/Line_segment Line segment from Wikipedia]
* [https://en.wikipedia.org/wiki/Pixel Pixel from Wikipedia]
* [https://en.wikipedia.org/wiki/Plane_%28geometry%29 Plane (geometry) from Wikipedia]
* [https://en.wikipedia.org/wiki/Polygon Polygon from Wikipedia]
* [https://en.wikipedia.org/wiki/Polygonal_chain Polygonal chain from Wikipedia]
* [https://en.wikipedia.org/wiki/Point_%28geometry%29 Point (geometry) from Wikipedia]
* [https://en.wikipedia.org/wiki/Point_in_polygon Point in polygon from Wikipedia]
* [https://en.wikipedia.org/wiki/Quadrilateral Quadrilateral from Wikipedia]
* [https://en.wikipedia.org/wiki/Rectangle Rectangle from Wikipedia]
* [https://en.wikipedia.org/wiki/Spline_%28mathematics%29 Spline (mathematics) from Wikipedia]
* [https://en.wikipedia.org/wiki/Texture_mapping Texture mapping from Wikipedia]
* [https://en.wikipedia.org/wiki/Triangle Triangle from Wikipedia]

==Toolkits, Libraries and APIs==
{{Graphic and Widgets}}
==Misc==
* [https://en.wikipedia.org/wiki/Hiromi_Uehara#Hiromi.27s_Sonicbloom Hiromi's Sonicbloom] - [https://en.wikipedia.org/wiki/Beyond_Standard XYG], [https://en.wikipedia.org/wiki/Blue_Note_Tokyo Blue Note Tokyo], November 29, 2007, [https://en.wikipedia.org/wiki/YouTube YouTube] Video
: [[Videos#HiromiUehara|Hiromi Uehara]], [https://en.wikipedia.org/wiki/Martin_Valihora Martin Valihora], [https://en.wikipedia.org/wiki/Tony_Grey Tony Grey], [https://en.wikipedia.org/wiki/David_Fiuczynski David Fiuczynski]
: {{#evu:https://www.youtube.com/watch?v=IZtG4CltzWA|alignment=left|valignment=top}}

=References=
<references />

'''[[Programming|Up one Level]]'''

Navigation menu