We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
normalized coords? (Read 552 times)
normalized coords?
Jul 2nd, 2008, 3:16am
 
i'm just trying to figure out if there's a way to use normalized coordinates directly in processing without having to write a custom function for converting them...

?

thanks,
e
Re: normalized coords?
Reply #1 - Jul 2nd, 2008, 6:08am
 
if you mean for UV's on shapes the you can use
Quote:
textureMode(NORMALIZED);


http://processing.org/reference/textureMode_.html
Re: normalized coords?
Reply #2 - Jul 5th, 2008, 10:52pm
 
i think what i meant was signed-normalized-coords.
what i've done is just to create a custom function that converts them so i can do things like

move3d(-1,1,0);

thanks,
e
Re: normalized coords?
Reply #3 - Jul 7th, 2008, 8:00am
 
There's a really good vector library that has many built in functions, including normalization.  It's a must have if you're doing anything in 3D.  Get it here: http://code.google.com/p/toxiclibs/

If you're using that library:

Vec3D move_vector = new Vec3D( -1, 1, 0 );

move_vector.normalize();

println( move_vector.toString() );

// access with move_vector.x, move_vector.y, move_vector.z

//etc....
Page Index Toggle Pages: 1