QUOTE// Normalize the arrayint $result = normalize($temp ); // this doens't work, I want it to renturn 1,0,0
1,0,0 is not the normalized vector of 3.234,-0.24,0.00234.
Normalized means that vector has a length of 1 unit in the same direction as the original vector.
any idea how to convert it to 1,0,0??
QUOTE(Rifz @ 02/15/07, 02:10 PM) [snapback]260100[/snapback]any idea how to convert it to 1,0,0??
haven't we all been here before..?!?!
ya but
vector $V=<>;vector $FN = <>;
still returns....
// Result: <> //
not 0,-1,0
: ) I'm not a math guy... help!
So you want your vector to "snap" to the closest axis, right? Snap to 1 of the 6 possible positions?Dude, I guess this is a good programming exercise for you to solve it all by yourself.
--- abs
QUOTE(Rifz @ 02/15/07, 03:36 PM) [snapback]260112[/snapback]ya but
not 0,-1,0: ) I'm not a math guy... help!
yeah, but don't you recall us telling you you had to declare intergers to return integers..?
CODEvector $V=<>;vector $FN = <>;
:nathaN
Thank you!! that works great! : )
Error: Backend Fetch Failure
We've been notified about this issue and we'll take a look at it shortly.
If you need to reach us, email support@highend3d.com