FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Suggestions
   Software Suggestions
(Moderator: fry)
   mouse and translate
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: mouse and translate  (Read 853 times)
benelek

35160983516098 WWW Email
mouse and translate
« on: Jun 25th, 2003, 6:34am »

in some of my more complex sketches involving the use of translate and mouse coordination, it's becoming a chore to keep track of the distance between mouseX and the X axis, and likewise mouseY and the Y axis. could some variables be built in to help keep track of the origin (like originX/originY) in relation to the initial origin (left/top)? this is also pretty useful when we run into rotations, etc.
 
fry


WWW
Re: mouse and translate
« Reply #1 on: Jun 25th, 2003, 6:42pm »

any thoughts on how such a beast might work? how would you take rotations into account? (since those flip the axis depending on where you are in space)
 
benelek

35160983516098 WWW Email
Re: mouse and translate
« Reply #2 on: Jun 26th, 2003, 3:19am »

i see what you mean - once a rotateY has been called, a rotateX will no longer just involve the "global" Y and Z axes of transformation, etc. lemme spend a few hours/days figuring out the math, then i'll post a sketch of it in working order.
 
arielm

WWW
Re: mouse and translate
« Reply #3 on: Jun 26th, 2003, 7:29am »

on Jun 26th, 2003, 3:19am, benelek wrote:
once a rotateY has been called, a rotateX will no longer just involve the "global" Y and Z axes of transformation, etc

 
hmm... seems that someone needs quaternions here
 

Ariel Malka | www.chronotext.org
benelek

35160983516098 WWW Email
Re: mouse and translate
« Reply #4 on: Jun 26th, 2003, 7:58am »

hehe, yes this maths is getting a lil' troublesome for my own capabilities. so i'll just propose an outline:
 
how about a few functions (similar to screenX(), etc) to convert transformed coordintes into their overlaid location on the original coordinate grid.
 
i'd appreciate any help in getting a few sketch functions working with the maths required (arielm? )
 
arielm

WWW
Re: mouse and translate
« Reply #5 on: Jun 26th, 2003, 8:53am »

on Jun 26th, 2003, 7:58am, benelek wrote:
hehe, yes this maths is getting a lil' troublesome for my own capabilities

 
well, me too... quaternions are totally unintuitive, quite black magic!
 
v3ga, where are you
 
it was just an intuition that quats could be involved in the system because they have some interesting properties, like solving the "gimbal lock" issue ("once a rotateY has been called, a rotateX will no longer just...").
 
what i understand at this point, is how to handle "unit" quaternions (i.e. normalized, mappable onto a sphere, able to represent rotations), useful for implementing a virtual trackball as in:
http://proce55ing.net/discourse/yabb/board_Tools_action_display__num_1056449368.html
 
now your example seems to involve a "chain" of translations, eventually with rotations, so i'm clueless at this stage...
 
maybe, one "unit" quaternion could be used for each "node" in the "chain", and then some smart algorithm could be used to compute the "inverse" of the chain when needed
 
starts to sound like "inverse kinematics" stuff... frightening!
« Last Edit: Jun 26th, 2003, 8:55am by arielm »  

Ariel Malka | www.chronotext.org
benelek

35160983516098 WWW Email
Re: mouse and translate
« Reply #6 on: Jun 27th, 2003, 3:25am »

as a matter of curiosity, how does Processing keep track of translated and/or rotated objects internally?
 
Pages: 1 

« Previous topic | Next topic »