Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
pasteta
pasteta's Profile
1
Posts
2
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
How to 'compare' information from an array with coordinates?
[3 Replies]
22-Jan-2011 02:19 PM
Forum:
Programming Questions
I'm new to processing so excuse me if I'm asking a stupid question.
I've been looking around a bit, but cannot figure out the answer.
I have an image with a green area (0,255,0) on it. I also have an red ellipse.
Now I want that when the red ellipse moves over / touches the green area, something will happen.
I made an array of the image, because I don't know how else to find the green area. And from the ellipse I have only the coordinates.
ellipse(mouseX,mouseY,30,30);
img = loadImage(image.png);
img.loadPixels();
for (int i = 0; i < img.pixels.length; i++)
{
if(img.pixels[i] == color(0,255,0))
}
Now I don't know how to make the interaction between those two.
I want to get that when the red circle is on the green area, he will do something.
Does anyone know how I can solve this?
«Prev
Next »
Moderate user : pasteta
Forum