confused about different methods of correcting window ratio for mouse coordinates

Dante's icon

Hi this seems like a basic question, but it has me stumped. I am trying to discern the difference between the two methods of getting the mouse coordinates and adjusting for window ratio, both of which i have placed in the attached patch.

one method works in situations such as, Federico's AMS tutorials. For a specific working example see the GL3 image to particles examples. (a non working example is in my attached patch)

the other method, which i got from Micron works in my attached patch.

If this is not just a misunderstanding on my part, I would like to know when to implement one example over the other.

Thanks for any help

mouseRatioQ.maxpat
Max Patch

Dante's icon

Thanks Raja.
Sorry, yes i forgot to retrigger the screentoworld message. I believe i understand the concept of screentoworld, but do not understand the '0 0' part. I imagine these are x and y coordinates, but am not sure?

Dante's icon

Thanks I appreciate your help Raja. yea i'm guessing the message is just used to negate the z coord.

I still would like to know why the AMS method becomes inaccurate when I put it in other patches, although now that I understand microns method more clearly I am more inclined to use. I guess you always have to have a backup :)