Right Mouse Button Click in OSX?

User support for JPatch

Right Mouse Button Click in OSX?

Postby pkazmier » Sat Jul 24, 2004 6:13 pm

Hi,

I'm a newbie to jpatch and computer graphics in general. Found POV-Ray, then found jPatch and although I'm not quite sure when one should use splines to model vs just plain old POV, I thought I'd give it a try. I'm going through the introductory tutorial, but got stuck trying to figure out how to weld two splines together on my mac. It says to move a point from one spline to the other, and then press the right mouse button to weld them. I have a one button mouse. Most of the time, right-clicking is simulated by holding down CTRL and then clicking which works in most cases. But jpatch is looking for that right-mouse click while I already have my first mouse button pressed down (so I can't do the CTRL-click).

Is there a keyboard short cut?
pkazmier
 
Posts: 3
Joined: Sat Jul 24, 2004 5:56 pm

Postby sascha » Sat Jul 24, 2004 7:03 pm

Well, unforunately JPatch checks for the mousebutton which was clicked and uses the control-key for different things... I'll try to change that in future releases, but for the time being you'd need at least a two-button mouse (although I highly recommend a three-button mouse with scrollwheel) - I think it should be possible to connect one of these usb-mice to a mac (?)

although I'm not quite sure when one should use splines to model vs just plain old POV

POV's scene description language (SDL) is very powerful, and you can "model" a lot of complex objects/scenes without a modeller. Although there are some excellent toon-like characters made of blobs, I think this is where the modify scene-code, test render, modify scene-cod, test render... loop starts to consume too much time and a graphical modeller would be handy.

JPatch aims at character animation, but it's work in progress and currently there are no animation features. I'd use it for all kinds of "organic" shapes - for everything else (everything that can be composed of primitives like cylinders, spheres, boxes...) I'd use pure-POV-Ray instead...
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Postby pkazmier » Sat Jul 24, 2004 8:55 pm

Thanks for the reply. Fortunately, I know Java, I'll just modify the sources so I can press the 'w' key or something like that to weld the points together. Thanks.
pkazmier
 
Posts: 3
Joined: Sat Jul 24, 2004 5:56 pm

Postby sascha » Sat Jul 24, 2004 9:24 pm

Fortunately, I know Java

Good!

Could you check if mouseEvent.isMetaDown() returns true for the "simulated" right mouse click on a Mac? I know that it returns true on windows for the right mousebutton - so it would be a possibility to check for both, right mousebutton OR CTRL-mouse on a Mac - I'd have to change the things which are dependant on CTRL in JPatch, but that should be possible...
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Postby pkazmier » Sat Jul 24, 2004 10:07 pm

Here are the results:

Pressing CTRL + Mouse Button results in:
isShiftDown() == FALSE
isAltDown() == FALSE
isMetaDown() == FALSE
isControlDown() == TRUE

Pressing the Apple key + Mouse Button results in:
isShiftDown() == FALSE
isAltDown() == FALSE
isMetaDown() == TRUE
isControlDown() == FALSE

So, unfortunately, it does not do as you had hoped. However, I am not sure how that would have worked anyways. In order to weld a point, I already have to have my mouse button pressed and held down so I can move the point over another point. If the button, the one and only button, is being held down, I would not be able to Ctrl+Click anyways.

I haven't looked at the rest of the code as it seems that the stuff in anon CVS repo on sf is old, is there a newer repository somewhere?
pkazmier
 
Posts: 3
Joined: Sat Jul 24, 2004 5:56 pm

source

Postby sascha » Sun Jul 25, 2004 11:42 am

Here are the results:

Thanks for testing that!

The cvs is completely outdated (currently I'm the only developer and I've been a bit lazy...)

The source is currently not fully documented and some classes are obsolete (but I'm working on it...), so it's not in the CVS.
But it is included in the distribution (in the src directory).

/net/sf/jpatch/... contains the JPatch source, /javax/vecmath a free vecmath package (normally part of Java3D) and /org/... everything needed for the xerecs xml parser.

The relevant classes for "welding" are
net.sf.jpatch.boundary.mouse.AddControlPointMouseAdapter and
net.sf.jpatch.boundary.tools.DefaultTool

You're right, the isMetaDown wouldn't work that way...
Alternatively to adding a key-listener another way could be to check if one of the modifier keys was down when the mousebutton was released.

I'll add an ant build-file later, but currently I'm not using ant (seems to be slow...) - I use jikes with -nowarn -depend to compile the main class (net/sf/jpatch/Modeler.java)

Please let me know if you've got something that works for a single-button-mouse!
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Welding with Mac single-button-mouse

Postby sascha » Sun Jul 25, 2004 11:49 am

Btw, does anybody know how Animation:Master handles welding on Mac's?
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Postby settra » Sun Jul 25, 2004 12:40 pm

what if instead of having to hold down the left mouse button, a simple click wouldn't be enough ?

example:
'shift a', LeftClick to place a point, move mouse to next point, LeftClick to place the point (and if there is another point in the same place, weld them), ...
holding shift while clicking could force not welding points (sometimes it's useful)

this would avoid having to hold down the mouse button
Last edited by settra on Sun Jul 25, 2004 3:05 pm, edited 1 time in total.
settra
 
Posts: 39
Joined: Thu Jul 22, 2004 7:30 pm

Postby Guest » Sun Jul 25, 2004 2:46 pm

I like that idea the best so far.
Guest
 

A:M

Postby CaM » Mon Jul 26, 2004 5:51 am

Hey sorry I haven't been participating in the forums recently. I've been so busy with school and work I haven't had any time.

When I used A:M we used the 'control' key and mouse button for right-click except when welding points or attaching hooks in which case the '~' key is used.

Hope that helps.
CaM
 
Posts: 11
Joined: Thu May 27, 2004 1:42 am


Return to Support / Help

Who is online

Users browsing this forum: No registered users and 2 guests

cron