erich666 / GraphicsGems

Code for the "Graphics Gems" book series
Other
1.39k stars 265 forks source link

Possible Planar Cubic Curves errata, first volume #24

Closed erich666 closed 6 years ago

erich666 commented 7 years ago

I may have found some errors in the article "Planar Cubic Curves" in the first Graphics Gems book that are not listed in the errata at http://www.realtimerendering.com/resources/GraphicsGems/Errata.GraphicsGems

Page 576:

Page 577:

In addition, on page 578, there is this equation:

f(x) = g(clamp(xL, xH, (x - xL)/(xH - xL)))

Since the (x - xL)/(xH - xL) part is remapping x from [xL, xH] to [0, 1], and g(x) seems to be expecting input values between [0, 1], why is the remapped value clamped between [xL, xH]? Shouldn't the remapped value be clamped between [0, 1] instead? I believe that would match the situation in Figure 4, and the equation would be:

f(x) = g(clamp(0, 1, (x - xL)/(xH - xL)))

Sincerely,

Mika Haarahiltunen

erich666 commented 6 years ago

Pinged Andrew.

erich666 commented 6 years ago

Andrew replies: Everything he says is right or equivalent-but-clearer, so I say all his points are valid.