comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: about WSET
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: about WSET [message #54737] Thu, 05 July 2007 14:26
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
airy.jiangwrote:

> 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.^_*

I guess you never got my DirectInput dlm to work? Is my code that bad?
:( I've done all of this for you... You never did say what platform
you are on and maybe that is the problem. It should work for Win2k/XP
with DirectX 9. What version of IDL?

-Rick
Re: about WSET [message #54751 is a reply to message #54737] Thu, 05 July 2007 03:10 Go to previous message
airy.jiang is currently offline  airy.jiang
Messages: 37
Registered: May 2007
Member
On 7 4 , 11 57 , "mgal...@gmail.com" <mgal...@gmail.com> wrote:
> On Jul 4, 7:55 am, David Fanning <n...@dfanning.com> wrote:
>
>> Well, now, there is an idea! I would package this up in
>> a new window object, though, so the object could keep
>> track of all the manipulations, resizings, etc. Then
>> you could just create a MoveCursorTo method.
>
> Yes, this definitely needs to be packaged in something for re-use.
>
> Mike
> --www.michaelgalloy.com

Thank you very much!
Now I got the answer,and I've made a nice effect of what I wanted.
Let's cheers!!^_^

ps:I've found another bug of IDL.I don't know whether you have met it
before.
Let's see this code:
IF (event.x LT 1) OR (event.x GT drawX-1) THEN BEGIN
TVCRS,0,0,/Device
ENDIF
When I move the mouse slowly or steady to the edge of the
Widget_Draw,the IDL can access the position of the mouse,and made the
right action that set the mouse to the [0,0],but If I move the mouse
very fast to the edge of the Window,it seemed that the IDL can't catch
the change of the mouse ,then the mouse moved to the outside of the
window ,rather than made the action that set the mouse to the [0,0].
You can test this,of course,this is not a big problem,we can use many
ways to avoid them,but it indeed exists.
Re: about WSET [message #54757 is a reply to message #54751] Wed, 04 July 2007 08:57 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Jul 4, 7:55 am, David Fanning <n...@dfanning.com> wrote:
> Well, now, there is an idea! I would package this up in
> a new window object, though, so the object could keep
> track of all the manipulations, resizings, etc. Then
> you could just create a MoveCursorTo method.

Yes, this definitely needs to be packaged in something for re-use.

Mike
--
www.michaelgalloy.com
Re: about WSET [message #54758 is a reply to message #54757] Wed, 04 July 2007 08:28 Go to previous message
Bob[3] is currently offline  Bob[3]
Messages: 60
Registered: December 2006
Member
On Jul 4, 1:48 am, airy.ji...@gmail.com wrote:
> 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

Seems to me the effect you are looking for isn't so much having the
"mouse offset" represent the "radian that "head" need to rotate", but
rather have the offset proportional to the rate of change of the
"head" turn.
By making the offset porportional to the rate of turn rather than the
absolute magnitude having the mouse cursor centered would keep the
viewing angle steady (no turn). Having it mouse at the left window
edge would have the view turning to the left at a maximum allowable
rate. Having the mouse partially to the left of center would turn the
"head" left at a slower rate. That would allow continuous rotation to
the left(right) whenever the mouse is to the left(right) of center.
I haven't played any first person angle games in quite a while, but
that is how I remember them working.

Being able to re-center the mouse, as Mike's pro above does would
still be useful to quickly stop any rotation.

Bob.
Re: about WSET [message #54760 is a reply to message #54758] Wed, 04 July 2007 06:55 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mike Galloy writes:

> How about this trick: put a direct graphics window (of the same size)
> behind the object graphics window.

Well, now, there is an idea! I would package this up in
a new window object, though, so the object could keep
track of all the manipulations, resizings, etc. Then
you could just create a MoveCursorTo method.

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.")
Re: about WSET [message #54762 is a reply to message #54760] Wed, 04 July 2007 01:24 Go to previous message
Michael Galloy is currently offline  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
Re: about WSET [message #54764 is a reply to message #54762] Tue, 03 July 2007 22:48 Go to previous message
airy.jiang is currently offline  airy.jiang
Messages: 37
Registered: May 2007
Member
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!
Re: about WSET [message #54767 is a reply to message #54764] Tue, 03 July 2007 21:13 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
airy.jiang@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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: format string with many many quotation marks
Next Topic: Re: format string with many many quotation marks

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:13:39 PDT 2025

Total time taken to generate the page: 0.00815 seconds