mouse 2 sketch

Dg's icon

Hello,

I need to give glvertex values to [jit.gl.sketch] from pwindow's mouse message, accurately as "left-top-right-bottom" values (see jit.lcd)

My matrix is 320/240 size, but glvertex think different!

Is there a way to do that?

I had a look at screentoworld in another topic, but can't figure out how to use it for such a goal.

thank you very much.

Rob Ramirez's icon

i do something like this, but may not work for everyone.
when math doesn't like you, trial and error is your friend.

Max Patch
Copy patch and select New From Clipboard in Max.

jasch's icon

jit.gl.render can tell you where your pixel is at:
send the mouseposition as screentoworld to the render and it gives you
OpenGL coords.

hth

/*j

Max Patch
Copy patch and select New From Clipboard in Max.

Dg's icon

Thank you Jasch.
Do you think you could post a patch for Max 4.6/1.6.3 ?

thank you.

jasch's icon

here you are:

Max Patch
Copy patch and select New From Clipboard in Max.