Mouse logic

boya's picture

Hey all, I need to pick up an in object and move it around the comp screen without the cursor being visible during a performance.

So I need to remeber the x,y for the object, and when the triggered the object should move by the mouse input. (not jump to the real positition)

This is probably simple, but I tried a cupple of sample/hold combinations, but no luck.

Chers!

dust's picture
Re: Mouse logic

go to preferences and hide mouse on full screen. this example is using a queue to save the last mouse coordinate much like sample and hold does. a instructional message will pop up if you are over the object as well as well as the color will change. in order to move the object you must right click and the object will follow the mouse and stay where you left it. i use this trick a lot for multi-touch as the tuio protocol defaults to x=0 y=0 if your not touching so the object will always bounce back to zero zero unless you store the last known number. there is a plugin similar to this its called ACNumber store you could try that as well.

Quote:
not jump to the real position
so im not entirely sure but i think this is what you want to do. you need to use logic && which basically means mouse xy must be over an object which equals true and the users trigger needs to be true as well or else leave the object. if you didn't use && logic then once you hit the object it will follow the mouse you need someway to drop it. you don't need to use mouse right click you can use space bar or what ever. if this is what you want then please try and explain again.

PreviewAttachmentSize
mouselogic.qtz24.71 KB

gtoledo3's picture
Re: Mouse logic

I think what he means by "jump", is that window focus got all screwed up in 10.6 (if you do live stuff w/ QC, it becomes VERY obvious). The second you touch the Editor window, or any other window, mouse events stop forwarding. Then put focus back on the Viewer, and whatever you were "mousing" has it's coordinates "jump" to wherever they are at that moment. This might be the first SL bug I noticed, because it's an extremely important thing to me....or maybe that's not what was meant.

Also of note is the fact that if you are using two displays, and launch QC Viewer in the secondary display, that even if you choose to hide mouse in fullscreen mode, QC ignores it. This happens in 10.5 or 10.6. Many types of systems require your output to be that secondary display, so that's another pretty big pain.

Cursorcerer used to work for me, but I started to use it the other day, and everytime I would grab something, the mouse cursor would reappear (this is in 10.5). So, this is something I've been thinking of as well.

dust's picture
Re: Mouse logic

yeah i remember we had a discussion based on how frustrating it was to not be getting your events forwarded correctly. i work around i was doing was to just use osc. but for what ever reason in an application context it seems some of that has been fixed. where as i can change the focus by hitting apple tab to lets say the finder and still forward some of my events even though the render view is not focused. so some changes must have been made in 10.6.1. as per QC it is still a bug. the interesting this i took the same patch posted above and built an xcode and qb app both seem to forward mouse events regardless of the focus. meaning the cursor is hidden in the app context once you switch focus to the finder safari what ever you can still move the ball around because once the focus is changed you now have your cursor back. so you can see where to click. the weird thing is the hit testing or hovering over the ball in this example in a non focused manner doesn't work. its not until you refocus to the render view that the cursor goes away and and the hit testing color change can be seen which i think would be essential trying to perform without a cursor you need someway of knowing where the mouse is to pick up and move an object. the really interesting thing is that the hit testing actually works unfocused if you know the logic. for instance you can hover over the ball but the color doesn't change. so we covered that but if you know the triger to move the ball is right click once your ontop of it then right clicking and moving the ball around totally works from a non focused perspective but you see the mouse. so im still confused as what is needed here but. if you want to control something off screen then jump to the render view of your quartz patch with hidden mouse because your recording or performing and do not want people to see your interaction then that is totally possible in an application setting. for instance you could screen capture just your render view but switch focus to the finder so you can see your mouse move the object around and not have your mouse in the recording.

i don't know if that helps but here are two ways to use your quartz patch with a hidden mouse.

boya's picture
Re: Mouse logic

Great, thaks for the help, but it`s probably more simple so I´ll try to rephrase myself:

I have projectors shooting down on a stage. There is an image acting as a lightcone hitting one of the actors. The rest of the stage is black, so the image acts as a light source. Now I want to make it into a "movinglight", by using the mouse to follow the actors movement.

So there is a stored value for the image position.

When i trigger the (invisible) mouse movement over the viewer I need to instantly reset the xy of the mouse to zero, since I´m unable to pick it up visibly, then use the mouse to move the image to its new position, then store xy again upon release.

Hope this makes it more clear.

dust; I was not able to restore your comp properly, something about

(null) : Patch with name "/instructions" is missing

Macro Patch Cannot create node of class "/instructions" and identifier "(null)" ...and so forth.

I´m in 10.5 8 maybe thts the cause, but I was able to highlight and pick up the sphere...

dust's picture
Re: Mouse logic

well that makes t easier to understand. i took out the instructions patch. so right now the sphere starts @ 0,0 once you right click it and move your mouse it will follow and stay where you left it until you hit the space bar at which point the sphere moves back to 0,0 for you to do all over again.

PreviewAttachmentSize
mouselogic.qtz5.57 KB

usefuldesign.au's picture
Re: Mouse logic

Quote:
When i trigger the (invisible) mouse movement over the viewer I need to instantly reset the xy of the mouse to zero, since I´m unable to pick it up visibly, then use the mouse to move the image to its new position, then store xy again upon release.

I guess that's an innovative way to do it — sounds a bit unresponsive and tricky to implement nicely to me.

Not how I would have gone for the effect you want which is essentially a cross between a follow spot and Pong (minus the player bats!) by the sound of it.

Not sure how you are capturing the image for video projection but if you can set the ROI to a subset of the quartz viewer window then set-up a double screen like two pages of an open book — left page for the cursor/targeting system then the right page for the moving 'spot' image taking it's (x,y(,z)) from offsets of the mouse.

You could use a right-mouse-button is active mode to interpret (x,y) mouse movements as z-axis movements to give your image a focus or ranging (Z position) control by shifting the image in Z-dimension (sprites only no billboards if you use the 3D transform patch!) or to blur/soften the image like a Fresnel lens can.

Probably easier just to use arrow keys for additional controls like size/z-axis/focus though.

If you can't sub-sample the viewer window then, like dust or george was saying, you can target/use cursor in one comp and pass the (x,y) delta to another comp via osc or even I think spooky (a kineme patch) passes between comps on same host machine. That's prob the way I would go first up.

Oh and one more thing, if you have access to a tablet, you always 'know' cursor position without seeing it on screen and you can even put a diagram under the clear sheet for more accuraccy.

boya's picture
Re: Mouse logic

Thanks, I really appreciate your Input!

dust: I need to be able to pick up the object without seeing the mouse cursor. I have a tripplehead (3072X768 screen) and loads of subpatches being fired up during the performance: the problem is that I have no way of hiting my 250 x250 object in blind. So wherever my mouse is at a triggering time needs to controll the object.

usefuldesign.au: not really pong, but a soft cone which leaves a trail after the actor usig core image accumulator. I will try out the tablet idea if I get hold of one.

dust's picture
Re: Mouse logic

well instead of a visual cue you can do an auditory que. this example uses a speech synth plugin from developer examples and says in if your over the circle or out if your not on it. this would be if you where using one qtz document spread across three screens. other wise if your just using the other screens to run other stuff you can always use the kineme spooky patch. basically you have one screen that is full with mouse hidden and then on the other screen not full screen you have the sender patch. so it sends the image from one patch to the other so you can see whats going on while you control another patch much like osc would do for numbers but for images. so i added some feed back. just open the get patch then the sender. make get full screen hide mouse. leave sender off screen smaller or just listen to the audio voice if you want to do everything blind. heck with a camera you can just track the actor without having to touch a mouse at all. let the camera do the work.

PreviewAttachmentSize
get.qtz15.56 KB
mouselogic_send.qtz10.18 KB