Message-ID: <36B8EA98.59FAFF73@ibm.net> Date: Wed, 03 Feb 1999 17:32:24 -0700 From: Benjamin Cutler X-Mailer: Mozilla 4.5 [en] (Win95; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Floating Point Problems... HELP References: <36AAA3C3 DOT 6DB3459F AT ibm DOT net> <36aac69e DOT 388339665 AT news DOT snafu DOT de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 32.100.230.85 X-Trace: 4 Feb 1999 00:31:18 GMT, 32.100.230.85 Organization: IBM.NET Lines: 40 X-Notice: Items posted that violate the IBM.NET Acceptable Use Policy X-Notice: should be reported to postmaster AT ibm DOT net X-Complaints-To: postmaster AT ibm DOT net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Horst Kraemer wrote: > > On Sat, 23 Jan 1999 21:38:28 -0700, Benjamin Cutler > wrote: > > > I trying to write a program. It's supposed to draw two triangles on the > > screen, and then move them back and forth. It draws them once, but then > > once it tries to redraw the moved triangles it crashes with a > > "floating-point exception". Can anybody offer any help? Do I need to go > > into more detail here? > > Definitely. > > Where to you need floating point when "redrawing" triangles ? > > The screen coordinates which you are drawing are integers, aren't they > ? > > Regards > Horst I use floating point in several things: Z-Buffering, Gouraud-Shading, Texture-Maps, and Translucency. What the routine does is split the triangle into several horizontal lines, then draw the lines. Each line has several variables: Integers: x1, x2, y; Floating Points: z1, z2 (for Z-Buffering) gi1, gi2, (Gouraud Shading Intensities at either end) tx1, tx2, ty1, ty2, (texture map coordinates at each end), and Factor (How translucent the line is). Some where when it is computing the z1 value it crashes. I don't have the code on this computer, but I'll try to get it to show it to you. -- Benjamin Cutler Racercks Productions chrystis AT ibm DOT net Owner/Head Programmer http://surf.to/rproductions/ AIM: DeFlama ICQ: #15277841 "The ones who think they know it all are very annoying to those of us that do." - Unknown