Microsoft KB Archive/42230

MSJ REVOLVE: OS/2 Graphics Programming Interface Code

PSS ID Number: Q42230 Article last modified on 04-16-1991

MS-DOS | OS/2

Summary: The following is a summary of the program found in the “Microsoft Systems Journal” and in the Software/Data Library: Issue: July 1988, Volume 3, Number 4, pages 23-40 Title: “OS/2 Graphics Programming Interface: An Introduction to Coordinate Spaces” Author: Charles Petzold Keyword: REVOLVE The use of GPI matrix multiplication to combine three transforms is demonstrated in the REVOLVE program. This program does some rudimentary animation using the GPI transforms. It shows the stick figure drawn the same way that it was in the TRANSFRM program (see article for more information on TRANSFRM), but subjected to three transforms in the REVOLVE function named SetModelTransform. REVOLVE can be found in the Software/Data Library by searching on the keyword REVOLVE, the Q number of this article, or S12143. REVOLVE was archived using the PKware file-compression utility. The following text is taken from the cover of the “Microsoft Systems Journal”: Coordinate spaces, which define drawing areas, are an important component of the OS/2 Presentation Manager. Transforms allow the mapping of objects from one coordinate space to the next. Coordinate spaces under the micro-PS and some of the GPI functions for handling transforms are explored.

More Information: This program demonstrates the following concepts of PM programs: 1. The relationship between the five coordinate spaces and four transforms that make up the transition from world coordinates to device coordinates 2. How a transform matrix can be used to shift, scale, rotate, and shear objects drawn with GPI primitives These concepts are demonstrated in this sample program by drawing a picture on the screen and then allowing you to manipulate the transform and see the changes in the picture that different transforms result in.