From: Richard R. <sf...@ol...> - 2003-09-30 13:50:36
|
On Tue, Sep 30, 2003 at 07:05:48PM +1000, Nigel Stewart and Fiona Smith wrote: > >>...there also appears to be > >>a problem with the solid cone... > > > >Is this the same bug with the cone about the base being drawn? > > I've identified a number of issues with glutSolidCone() [...] Re-reading your code, I misunderstood how much you reduced the code. I really didn't appreciate it. (Partly because I didn't read your code that carefully, but got hung-up over things like your use of assert(). (^&) I think that if you move the table initialization to a separate function so that the other shape sine/cosine-using shapes can exploit the work (and hide all of the allocation, error-checking, error messages, and array filling in the one function), this would be good. I'm skeptical about its value as an optimization, but I do agree that it seems to be an improvement to the code. I would add one point, however: > z0 = z1; z1 += zStep; > r0 = r1; r1 -= rStep; IMHO, it's better to do a multiplication than a summation. It's not really any faster to do this, and at least in principle, numerical errors build up. (In practice, as long as n is tiny, no one will care. (^&) -- "I probably don't know what I'm talking about." http://www.olib.org/~rkr/ |