i have some normals of differing length that i would like to set to be either -1, 0 or 1. Could someone point me to the right function in a wrangle on how to do this?
I tried using a foreach to loop through each vector component, check if it was more or less than 0.0 and then use either the floor or ceil functions to get what i want - but i don't think using it correctly.
If someone could first show me how to use my code properly to loop through the vector array that would be great - then if anyone has a cleaner solution to show me (im sure there is plenty!) that would be amazing!
Any info / pointers much appreciated!
Thanks in advance,
C
foreach(float num; @N) { if(num < 0.0) { printf("%d", num); num = floor(num); } }