Article View: rec.games.programmer
Article #440Re: Game libraries...
From: sl8nl
Date: Thu, 06 Aug 1992 00:09
Date: Thu, 06 Aug 1992 00:09
30 lines
2056 bytes
2056 bytes
> Before I get any more e-mail on this topic, I apologize for jumping the gun > before I saw the code. I haven't tried it yet, but I guess it's pretty obvious > he does know what texture mapping is. I would like somebody to explain, though, > how his code resembles a simple line drawing algorithm. I would also like to > hear some comments on the limitations of this method. OK, I will post pseudo-code, but for now, a simple explanation: First, the scaling code. The Bresenham line drawing revisal was implemented into the CreateScaleTable. What happened here is the routine "draws" a line from point A to point B. Whenever the line would normally increment the Y coordinate (this is for scaling down), a whole row or column was cut. Scaling up, it would total the number of pixels it could put on one Y row and store it. When the routine went down a Y row, the index was incremented and it started on the next line of pixels. The rest of the scaling code had nothing to do with Bresenham. That is why it is possible to create the tables in advance. The perspective code added one more twist...this time an actual line (i.e. calculated to determine the slope of the perspective). This was done in CreatePerspectiveTable...just a line drawing algorithm that was toned down. That's all. Without getting technical (yet), it would determine the number of Y pixels down, subtract that from the new (requested) total height of the image twice (or times by two and subtract), and then create a Scale Table for that row as described above. Taht's all there is to the code. Josh
Technical Details
Message-ID:
<1992Aug5.180901.57892@cc.usu.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!caen!hellgate.utah.edu!cc.usu.edu!sl8nlReferences:
<1992Jul29.001213.57596@cc.usu.edu> <1992Jul29.005516.57598@cc.usu.edu> <1992Aug5.172543.3507@esds.mdc.com> <1992Aug5.195205.5840@esds.mdc.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!caen!hellgate.utah.edu!cc.usu.edu!sl8nl From: sl8nl@cc.usu.edu Newsgroups: rec.games.programmer Subject: Re: Game libraries... Message-ID: <1992Aug5.180901.57892@cc.usu.edu> Date: 5 Aug 92 18:09:00 MDT References: <1992Jul29.001213.57596@cc.usu.edu> <1992Jul29.005516.57598@cc.usu.edu> <1992Aug5.172543.3507@esds.mdc.com> <1992Aug5.195205.5840@esds.mdc.com> Organization: Utah State University Lines: 32