Can't this be done in J right now using existing events? There is the mmove event with the ctrl and shift keys which should provide the tools to do most of this. Right now only the left and right button are supported and no alt key, but first we need to show that this would be useful. Some mice have lots of buttons. As for hiding the cursor, maybe defining a cursor that is all transparent would do that.

We could try more than one method of mouse functionality. Two ways are listed here.

Once done it's usefulness could be determined and if useful, support added by Jsoftware if needed to make it work more smoothly.

Oleg Kobchenko wrote:

This is an due discussion, because J support for
OpenGL does not utilize a mouse so far.

However, the proposed approach is versatile, but
complicated and for complicated operations, whose
purpose is not explained. I can envision that with these
kinds of features one can _manipulate_ the objects
as in a 3D design space, such as CAD or 3D
modeling applications.

I believe we are not there yet. Meanwhile, mouse could
be used to facilitate _exploration_ and _movement_.
This does not require all the mentioned facilities, but
can easily create an intuitive environment.

I like the approach taken by VRML, which operates camera position
and orientation. Regular mouse behavior (without 3D capture) is combined with modifier keys.

Mouse movement positions the cursor, dragging mouse
changes the view point:
 - no modifier: move around (fly or walk)
      up/down: zoom, left/right: turn changing direction
 - alt: pan
 - ctrl: study (rotate the space sphere along meridian and equator
      ralative to the closest object in the live of view)
 - shift: increase spead

This interface alone should be able to make a more
dynamic and natural alternative to the i,o/x,y,z/i,j,k etc. keys.

It only requires one mouse button. It maps easily to
the state of the viewpoint, and changes it relatively, rather
than requiring to map window coordinates to 3D corrdinates.
It does not require a 3D cursor.


VRML goes further allowing natural selection of objects
by direct clicking and then you can further modify the
selected object or use it as a handle to modify other things.
But that's further along.


--- "Miller, Raul D" <[EMAIL PROTECTED]> wrote:

In principle, we're going to get a more flexible and powerful interface
to opengl in the next month or so.  It would be nice if we got better
mouse support along with that.

One rather obvious issue is that it would be nice to get support for
more than two buttons (including the mouse wheel, or maybe even
wheels for a multi-wheeled mouse).  Since this ties into J's event
handling system, I'm not sure how if it could be done from user
space.

Another issue is that mouse coordinates are in what opengl documentation calls "window coordinates", and very little is done in opengl using window coordinates. Much more useful would be a way of manipulating using object coordinates or
eye coordinates or something of that nature.  The problem
is that in some cases converting from window coordinates
to object space coordinates can be difficult.

Here's an idea for making that happen (based on what I've
seen done in other software):

(1) Make the mouse pointer invisible (and maybe grab its
window coordinates at the start of this -- the application
can convert these to approximate object space coordinates).

(2) Position the mouse pointer in the center of the
opengl rendering area.

(3) Every time a mouse event is generated, the mouse's
deltaX and deltaY are obtained and the mouse is
repositioned in the center of the opengl rendering area.

These deltaX and deltaY numbers (and perhaps deltaZ from
the mouse wheel) would then be used to manipulate a
"mouse object" which the application program would render
inside the opengl window.

Note that the application might have to give up control of
the mouse under some circumstances (for example, under windows a person can use various key combinations to switch
to another task).  So I guess there would have to be a
"give up the mouse" event of some sort and a "ok, you can
have it back" event.

Probably most of this can be managed from user space.

Things I don't know about:

[1] How to know when another application has gained control of the mouse. (Even if I never see anything happening there, maybe the mouse needs to be made invisible again, and repositioned in the center of
the opengl isigraph control when I get control back).

[2] How to make the mouse invisible in the first place.

[3] How to set the mouse position in the center of the isigraph control (or, perhaps, in the center of the
parent form, or the center of the screen).

Popping the mouse in and out of this mode is another
issue, but it's easy to think of solutions for them
(hit a key or a mouse button to toggle, maybe).

Call this a wishlist item.  Or maybe a request for
documentation?

Thanks,

--
Raul ----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm



----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to