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.
IndexProgramming Questions & HelpSyntax Questions › coordinates translate
Page Index Toggle Pages: 1
coordinates translate (Read 381 times)
coordinates translate
Feb 5th, 2009, 11:35am
 
Hi there.
I want to move the (0,0) point to the center of my sketch and I use the "translate" function.
I use the blob detection library, and  I want to get the coordinates of the blob detected in relation with the center of the x,y axis. As I understood, when I use the translate function the coordinates of the blob detection do not change with the translate function.
How can i change them too and make the (0,0) on the center?
Thanks in advance.

Re: coordinates translate
Reply #1 - Feb 7th, 2009, 2:51am
 
If you mean you want to measure the coordinates relative to the center of the sketch instead of the top left, just add "+ width/2" and "+height/2" to the x and y coordinates you're working with, respectively.  
Not sure if that's what you mean though...
Re: coordinates translate
Reply #2 - Feb 7th, 2009, 5:44pm
 
I mean that I want the x, y coordinates to be in the center of my sketch. The (0,0) point to be exactly in the center.
The +width/2 and +height/2 works but I think that it is not global and I can not have the center of x/y axis on the center of my sketch for the blob detection library. It only changes for the setup, not for the library.
I want to have the returned value of the blob in relation to the center of the axis, that's why I need to have it in the center.
Page Index Toggle Pages: 1