That's clamp. Normalise in GLSL terms is a vector function. It sets the magnitude of a vector to 1.00. It's used for example in lighting equations to scale a normal vector to the correct magnitude for correct lighting calculation. In more general terms, I think normalisation just means scaling a number into the 0-1 range (but I'm vague on mathematical terminology myself). What you're doing below is clipping the value, as opposed to scaling. Values above and below the clipping range would be lost.
a|x On 9 Feb 2011, at 07:22, Alastair Leith <qc.student...@gmail.com> wrote: > would this JS function be correctly called Normalize or Clamp? > > function Normalize (a) > { > b = Math.min (1, Math.max(0, a)); > return b > } > > Does normalizing typically map a whole (defined) range of values to [0,1] or > just Filter/Clamp values to [0,1]? I read the OpenGL doc > (GLSL-Land-spec-4.00.8) but I'm none the wiser. > > best > alastair > > > The notion of looking on at life has always been hateful to me. What am I if > I am not a participant? In order to be, I must participate. > Antoine de Saint-Exupery > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Quartzcomposer-dev mailing list (Quartzcomposer-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/quartzcomposer-dev/the_voder%40yahoo.co.uk > > This email sent to the_vo...@yahoo.co.uk
_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartzcomposer-dev mailing list (Quartzcomposer-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com