POV-Ray : Newsgroups : povray.programming : Ever-So-Slightly Better Hermite_Cubic : Ever-So-Slightly Better Hermite_Cubic Server Time
28 Jul 2024 06:15:21 EDT (-0400)
  Ever-So-Slightly Better Hermite_Cubic  
From: Tony[B]
Date: 12 Oct 2002 00:15:26
Message: <3da7a1de$1@news.povray.org>
I came up with this today (Oct. 11), while adding that extra line the Slime
found was missing in normal.cpp. Look for the next to last function, called
Hermite_Cubic. It's called by Do_Slope_Map. This version saves 1
multiplication and 3 additions over the original one.

static DBL Hermite_Cubic(DBL T1,UV_VECT UV1,UV_VECT UV2)
{
  DBL T0 = T1 - 1;
  DBL rv;

  rv = S2 * T0 + (P1 - P2) * (2.0 * T0 - 1);
  rv = T1 * rv + S1 * T0 * T0;
  rv = T1 * rv + P1;

  return (rv);
}

--
Anthony Bennett


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.