Forums > MaxMSP

Calculate Area of a simple LCD drawing

February 28, 2012 | 10:56 pm

Hello everybody,

I’m pretty new to Max and I have some troubles doing a simple thing.
I want to be able to output the minimum and maximum values of both x and y when drawing in an LCD object, in order to calculate its simplified area.
Indeed, this technique will not calculate its precise area but the area of the rectangle created by taking these values. (this is what I want)
I have trouble to output the maximum and minimum x and y values of a drawing.
Here is what I’ve tried:

– Pasted Max Patch, click to expand. –

The problem is that the "maximum" object doesn’t seem to receive the "bag" information simultaneously so it doesn’t output the maximum of the bag’s list.

I hope someone can help me!
I’m sure the solution to my problem is simple but I don’t know how to solve it.

Thank you!
Ugo



MIB
February 29, 2012 | 1:34 am

try the patch below… should do the trick…

– Pasted Max Patch, click to expand. –

ooops. should have read better… this will only calculate the area of the click on and click off area…
not the maximum drawn area….



MIB
February 29, 2012 | 1:53 am

a quick hack… I think this works…

– Pasted Max Patch, click to expand. –

February 29, 2012 | 2:18 am

Wow! This was my first post on the forum and I can say that it is awesome :)
Thank you very much for the quick answer, I really appreciate!
By the way, I also tried to figure out the problem on my own and I came out with this solution.

– Pasted Max Patch, click to expand. –

But yours is nice too because it draws the actual rectangle over it! Very professional indeed.

Thank you again MIB


Viewing 4 posts - 1 through 4 (of 4 total)