Hi Alastair,

as I understand "nomalizing" it only works with vectors, because only a vector 
has a "length".

From the GLSLLangSpec.4.00.8:

"genType normalize (genType x) - Returns a vector in the same direction as x 
but with a length of 1."

Is this what you need? I what context do you need this in JS?

best,

Achim Breidenbach
Boinx Software


On 09.02.2011, at 08:22, Alastair Leith 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/achim%40boinx.com
> 
> This email sent to ac...@boinx.com

 _______________________________________________
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

Reply via email to