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

Tony Parisi tparisi at gmail.com
Wed Sep 22 19:24:57 PDT 2010


Hmmm,

This might be an implementation artifact (possible even in two players), or
it might be correct to-spec behavior.

But now we've gone beyond my ability to visualize. Hoping KV can weigh in.
Keith are you listening?!

Tony

On Wed, Sep 22, 2010 at 6:27 PM, Dave A <dave at realmofconcepts.com> wrote:

>  Yeah. I try to save myself some time/trouble by asking if anyone's seen
> anything, such that I don't have to reinvent a wheel.....
>
> Anyway, I see this behavior in Vivaty and Contact.
>
> Imagine you have a plane. Let's say it's face-on to the screen. The
> PlaneSensor works well in this case, and setting min.y = max.y will restrict
> motion to just X. That's fine. Intuitive interaction.
>
> Now navigate such that the plane is not face-on to the screen. It's a
> rhombus. If you were to draw bisectors on the plane (its local axes), you
> would see a line representing the X axis no longer parallel to screen X, and
> Y no longer parallel to Y.
>
> Now when you get translation events from the sensor, there are X and Y
> components to that. But if you map that to motion, you'll see that MOUSE
> motion in any direction will result in object motion (in one direction). And
> when the unwanted axis is 'shorter' (more oblique), there is much more
> motion resulting from mouse-movement in that direction. It's a horribly
> non-intuitive interaction.
>
> It's hard to describe, sorry, but try it. Make something in Vivaty studio
> with a PlaneSensor and just set the min/max values. Then run it, rotate the
> scene around, and play with it. Won't be long before you run into this
> behavior.
>
> I imagine I may have to transform the sensor's values to screen coords,
> filter, and transform back?
>
> Dave A
>
>
>
>
> On 9/22/2010 5:34 PM, Tony Parisi wrote:
>
> 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
>
>


-- 
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/cd89702b/attachment-0001.html>


More information about the X3D-Public mailing list