Re: about WSET [message #54762 is a reply to message #54760] |
Wed, 04 July 2007 01:24   |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On Jul 3, 11:48 pm, airy.ji...@gmail.com wrote:
> On 7 4 , 12 13 , David Fanning <n...@dfanning.com> wrote:
>
>
>
>> airy.ji...@gmail.com writes:
>>> Last day I wrote a question to ask how can I set the mouse to the
>>> position I want.David showed me a nice way that using the TVCRS.I
>>> tried it,and found that the TVCRS indeed changed position of the
>>> mouse,but not the exactly position I wanted.I did some test,and I
>>> found the reason of wrong position is because my program used the
>>> object-oriented graphics mode.The TVCRS will set the mouse of the
>>> widget which id is reading from the system variable !D.Window.I
>>> checked that variable,found that the widget id which restored in the !
>>> D.Window is not the id of the draw widget in my program.So it made a
>>> wrong position of the mouse.Then I want to set the draw widget of my
>>> program to be the active widget which can be useful to the TVCRS,I
>>> used the WSET method seting the draw widget,but the IDL reported a
>>> error message :"WSET:Window is closed and unavailable."
>>> Oh,what can I do?~_~
>
>> Unfortunately, I think the answer is "not much." I spent
>> the better part of a half hour this afternoon fooling
>> around with this, and I couldn't come up with a thing.
>> From the deafening silence, I'm afraid others are striking
>> out, too.
>
>> It probably goes against some GUI principle to allow
>> anyone other than the user to control the mouse, but
>> I guess I could think of one or two reasons why you
>> might have legitimate reason to want to do so. In any
>> case, unless I've missed something, I don't think it is
>> possible in object graphics. (Of course, you could put
>> an arrow or something inside a graphics windows and move
>> THAT around, but that isn't the cursor.)
>
>> Cheers,
>
>> David
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming:http://www.dfanning.com/
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> Thank you again,David.
> I don't know wheather you have been played the first person angle
> games like Quake3 or Counter Strike.In this games ,we can use the
> mouse to control the rotating of the "head",we can move the mouse to
> the left represent the "head" rotating to the left even if move the
> mouse to the side of the screen it still can be useful.I recorded the
> start position and end position of the mouse moving,use the offset
> representing the radian that "head" need to rotate.But when I move the
> cursor to the side of the screen,I have no idea how to make a
> continuous rotating of the "head",because I can't use the offset of
> the cursor movement to represent the radian that "head" rotating in
> this situation.So I think if this situation happened,I can set the
> mouse to the center or the other side of the screen,then I can make a
> continuous one direction mouse moving which is representing the
> continuous rotating of the "head".In fact,there must be some other way
> to realize this effect.Like DirectX and OpenGL all have their own
> function to realize this effect.But I'm highly wished we can use the
> IDL to realize it.
> Hope I've interpreted it clearly.Please parden my poor english.That is
> also a hard work for me too.^_*
> Thanks!
How about this trick: put a direct graphics window (of the same size)
behind the object graphics window.
Check out:
http://michaelgalloy.com/wp-content/uploads/2007/07/cursor_t est.pro
and let me know if that is the effect your are looking for. Push any
ASCII key or the button on the bottom to move the cursor to the given
location (x: 200, y: 100).
Mike
--
www.michaelgalloy.com
|
|
|