[X3D-Public] Any way to do a 'LineSensor' (Like PlaneSensor but in one dimension)

Tony Parisi tparisi at gmail.com
Wed Sep 22 17:34:32 PDT 2010


Poor Dave, they're still bashing you after all these years. I feel for ya
man.

Ok now on-topic: if I recall, there is a way to constrain the PlaneSensor to
one dimension. From da spec:

"*minPosition* and *maxPosition* may be set to clamp
*translation_changed*events to a range of values as measured from the
origin of the Z=0 plane of
the local sensor coordinate system. If the X or Y component of
*minPosition*is greater than the corresponding component of
*maxPosition*, *translation_changed* events are not clamped in that
dimension. If the X or Y component of *minPosition* is equal to the
corresponding component of *maxPosition*, that component is constrained to
the given value. This technique provides a way to implement a line sensor
that maps dragging motion into a translation in one dimension."

Tony

2010/9/22 Dave A <dave at realmofconcepts.com>

>  You don't have to be jerks about it. I've been scripting this crap for
> years.
> A more constructive response would be something on the order of how to
> apply some transform or something to the raw value coming from the
> PlaneSensor.
> For your information, I DO have a script to filter out the unwanted axis,
> but simply doing
> that as you say is not enough.
> And did you know that if you set the min/max values to zero, you don't need
> a script
> to set them to zero?
>
> Why do people not bother to think about what they say before hitting Send?
>
>
>
> On 9/22/2010 4:55 PM, Pierre Côté wrote:
>
> Because people do not know (always) how to do scripting... It’s a learning
> process...
> pc
>
> Le 10-09-22 19:49, « Paul Aslin » <fabricatorgeneral at yahoo.com> a écrit :
>
>
>
>
> --- On Thu, 23/9/10, Dave A <dave at realmofconcepts.com> wrote:
>
> > From: Dave A <dave at realmofconcepts.com>
> > Subject: [X3D-Public] Any way to do a 'LineSensor' (Like PlaneSensor but
> in one dimension)
> > To:
> > Cc: "x3d-public at web3d.org" <x3d-public at web3d.org>
> > Received: Thursday, 23 September, 2010, 8:27 AM
> >  I need to be able to drag objects
> > along one dimension only, and I'd like the interaction to
> > look natural too.
> >
> > A PlaneSensor can let you drag things, and restrict
> > *movement* using the min/max fields (set them to the same
> > value, say, 0).
> >
> > The problem is, they *detect* mouse movement in both
> > directions, and arbitrary movement always produces some
> > movement in both directions. The result is, for example,
> > moving the mouse up/down the screen produces movement
> > right/left in the object. This is bad.
> >
> > So, is there any way to restrict the detection of mouse
> > movement? Is there a different type of sensor available. I'm
> > using Contact, maybe they have something handy?
>
> Just use a Script node to filter the output and set the unwanted value to
> zero.
>
> Why to people on this list demand new nodes for something that can be
> solved with a few lines of scripting ?
>
>
>
>
>
> _______________________________________________
> X3D-Public mailing list
> X3D-Public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>
> _______________________________________________
> X3D-Public mailing listX3D-Public at web3d.orghttp://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>
> _______________________________________________
> X3D-Public mailing list
> X3D-Public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>


-- 
Tony Parisi                             tparisi at gmail.com
CTO at Large                         415.902.8002
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20100922/22deda17/attachment-0001.html>


More information about the X3D-Public mailing list