No, you'll always need a maximum value to do a scalar normalisation,
otherwise you don't know what value to scale the other values with
(if you see what I mean). With a vector normalisation, you know the
maximum value, because it's just the max of the vector dimensions.
a|x
On 9 Feb 2011, at 11:08, Alastair Leith wrote:
Thanks Alex and Achim
Ok, Vector not scalar. Now I get it. I was wondering how it could
scale without a scale co-efficient.
On 09/02/2011, at 7:35 PM, Alex Drinkwater wrote:
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-
d...@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