Mail Archives: djgpp/1999/02/03/19:36:17
Horst Kraemer wrote:
>
> On Sat, 23 Jan 1999 21:38:28 -0700, Benjamin Cutler <chrystis AT ibm DOT net>
> 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
- Raw text -