algorithmic modeling for Rhino
Hey Phillip. I'm confused by your question. What do you mean 'backward stuff'? The IsKeyPressed component returns a boolean value (True/False) based on the current state of the key you're testing. To make it backwards... it seems like you want to start with a true/false value and trigger a key pressed. How would this be done? I think I could technically write something that would simulate pressing down a key (I think) but is this what you want to do? How would this help you? It seems like if you're using the Kinect and you want to trigger something with a boolean value... this should be relatively easy just depending on how you setup the boolean trigger. Perhaps I'm not being clear... or don't properly understand the question. Could you elaborate a little?
Thanks,
Andy
yess, that exactly what I wanted.
I am thinking of doing a simple interface on kinect where two hands rignt means "right" on the keyboard,
and two hands lef means "left" on the keyboard, and so on so far. For example, we can play pacman with dancing through this
I will apreciate any help
But, couldn't you just create the boolean pattern based on geometry (there's no need to simulate a key pressed). For example... you said two hands right (I assume you mean if two hands are pointing to the right) then you could just test whether the position of both hands were in a certain quadrant located relative to the body (to the right). If both hands are in this position, the the boolean will be true, otherwise, it will be false. You can setup many different zones, and any time your hands pass through different zones it will turn that boolean to true and you can trigger some action. I believe Brian Harms tried something like this a while back: http://www.grasshopper3d.com/video/kinect-grasshopper-interface-avi
Is this what you're after?
-Andy
what you writed is definetely a first part of work. but I dont want (and cant) develop a new pacman game or anything else. The point here is that I want my script to affect outer application (pacman, piano simulator, mario brothers etc) through grasshopper, and for that staff I need to emulate "classical" input metods
Oh.... I guess I didn't understand you wanted to affect a program outside the interface of Rhino/Grasshopper (sorry for being dense). So, to answer your question (now that I understand it)... I think this could be pretty difficult. I mean, I think I could simulate a key press, that's not too hard... but I don't think the application would be listening for the key press since it's not the 'active' application being run. Since Rhino is the primary application that is running the code, the key press would be registered here (and not with other applications). I think you would have to modify the pacman game in order to poll the computer or listen for specific events. I'm taking a stab in the dark... but it seems like it could be difficult to do. I can try to look more closely into this... but I think it's going to be pretty hard to pull off.
-Andy
ok, thank you Andy for detailed explanation!
hey Philipp. Did you manage to do it ? I'm interested in this myself. I know that it's possible in processing and it works with some software (new games have a built in protection).
Thanks,
Alex
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by