From: Stef M. <s.m...@ru...> - 2008-12-04 22:57:44
|
hello, probably another simple question (for those who are known with vector algebra), how do I determine if I click in the corner region of a box or somewhere on the middle. the idea is that dragging, - should rotate the box if the start drag is in the corner - should move the object is hit some where in the middle thanks, Stef Mientki |
From: Bruce S. <Bru...@nc...> - 2008-12-05 03:26:34
|
The general case is complicated, but it might not be too difficult in a particular situation. From the documentation on mouse events: ray A unit vector pointing from camera in the direction of the mouse cursor. The points under the mouse cursor are exactly { camera + t*ray for t>0}. Also note the project() function for projecting the mouse position onto a given plane. I'm afraid that it's up to you to use these tools; your question is not a simple one. Bruce Sherwood Stef Mientki wrote: > hello, > > probably another simple question (for those who are known with vector > algebra), > how do I determine if I click in the corner region of a box or somewhere > on the middle. > > the idea is that dragging, > - should rotate the box if the start drag is in the corner > - should move the object is hit some where in the middle > > thanks, > Stef Mientki |
From: Stef M. <s.m...@ru...> - 2008-12-05 12:33:12
|
thanks Bruce, Bruce Sherwood wrote: > The general case is complicated, but it might not be too difficult in > a particular situation. From the documentation on mouse events: > > ray A unit vector pointing from camera in the direction of the mouse > cursor. The points under the mouse cursor are exactly { camera + t*ray > for t>0}. > > Also note the project() function for projecting the mouse position > onto a given plane. > > I'm afraid that it's up to you to use these tools; your question is > not a simple one. Well the question was simple, but the solution isn't ;-) I think for the moment (and maybe forever) I'm going to use alt/ctrl/shift to differentiate between actions. cheers, Stef > > Bruce Sherwood > > Stef Mientki wrote: >> hello, >> >> probably another simple question (for those who are known with >> vector algebra), >> how do I determine if I click in the corner region of a box or >> somewhere on the middle. >> >> the idea is that dragging, >> - should rotate the box if the start drag is in the corner >> - should move the object is hit some where in the middle >> >> thanks, >> Stef Mientki > > Het UMC St Radboud staat geregistreerd bij de Kamer van Koophandel in het handelsregister onder nummer 41055629. The Radboud University Nijmegen Medical Centre is listed in the Commercial Register of the Chamber of Commerce under file number 41055629. |
From: Scott D. D. <Sco...@Ac...> - 2008-12-05 17:21:46
|
Stef Mientki wrote: > Bruce Sherwood wrote: >> ... ray A unit vector pointing from camera in the direction of the mouse >> cursor. The points under the mouse cursor are exactly { camera + t*ray >> for t>0}. >> Also note the project() function for projecting the mouse position >> onto a given plane.... > Well the question was simple, but the solution isn't ;-) > I think for the moment (and maybe forever) I'm going to use > alt/ctrl/shift to differentiate between actions. Note that a box has 6 planes (at most three visible), so you could project onto each plane, determine if the point is on-box, and choose the "closest" of the on-box points. --Scott David Daniels Sco...@Ac... |
From: Anders P. <an...@gm...> - 2008-12-05 13:01:15
|
Alternatively you can put smaller objects at the corners of the box and maintain their positions as the box is moved or resized. Clicking/dragging these objects would mean to perform one action while clicking the box can do something else. This has the additional benefit of showing the user graphically where to click for different effects. The main downside is the increased complexity. Any comments on this general solution? /Anders On Fri, Dec 5, 2008 at 12:48 PM, Stef Mientki <s.m...@ru...> wrote: > >> thanks Bruce, >> >> Bruce Sherwood wrote: >> > The general case is complicated, but it might not be too difficult in >> > a particular situation. From the documentation on mouse events: >> > >> > ray A unit vector pointing from camera in the direction of the mouse >> > cursor. The points under the mouse cursor are exactly { camera + t*ray >> > for t>0}. >> > >> > Also note the project() function for projecting the mouse position >> > onto a given plane. >> > >> > I'm afraid that it's up to you to use these tools; your question is >> > not a simple one. >> Well the question was simple, but the solution isn't ;-) >> I think for the moment (and maybe forever) I'm going to use >> alt/ctrl/shift to differentiate between actions. >> cheers, >> Stef >> >> > >> > Bruce Sherwood >> > >> > Stef Mientki wrote: >> >> hello, >> >> >> >> probably another simple question (for those who are known with >> >> vector algebra), >> >> how do I determine if I click in the corner region of a box or >> >> somewhere on the middle. >> >> >> >> the idea is that dragging, >> >> - should rotate the box if the start drag is in the corner >> >> - should move the object is hit some where in the middle >> >> >> >> thanks, >> >> Stef Mientki >> > >> > >> >> >> |