[X3D-Public] Dragging things in screen-space
Christoph Valentin
christoph.valentin at gmx.at
Mon Oct 24 13:25:46 PDT 2011
Hi
Do not know: do you mean dragging *in* the plane of the screen (like a
HUD), or do you mean *parallel to* the plane of the screen, but at a fixed
coordinate within the scenery?
For first case here a little example of a rotary knob within a HUD, which
was used to control some parameter of the scene (not shown here).
<Transform DEF='HudTransform'>
<Switch DEF='KnobSwitch'>
<Transform DEF='KnobTransform'
rotation='1 0 0 1.570796'
translation='0.2 0.25 -1'>
<Transform DEF='KnobRotation'>
<Shape DEF='Knob'>
<Cylinder height='0.01'
radius='0.05'/>
<Appearance>
<Material />
<ImageTexture
url='"knob.jpg"' />
</Appearance>
</Shape>
</Transform>
<CylinderSensor DEF='KnobCS'
description='click
and drag to rotate knob'
minAngle='-1.570796'
maxAngle='1.570796'
diskAngle='1.570796'
/>
<ROUTE fromField='rotation_changed'
fromNode='KnobCS'
toField='rotation'
toNode='KnobRotation'/>
</Transform>
</Switch>
</Transform>
<ProximitySensor DEF='HudProximity' size='1000000 1000000 1000000' />
<ROUTE fromField='position_changed' fromNode='HudProximity'
toField='translation' toNode='HudTransform' />
<ROUTE fromField='orientation_changed' fromNode='HudProximity'
toField='rotation' toNode='HudTransform' />
Should be easy to change from cylinder sensor to plane sensor
Hope it helps :)
Christoph
>
> -------- Original-Nachricht --------
> Datum: Sat, 22 Oct 2011 16:40:19 -0700
> Von: Dave A <dave at realmofconcepts.com>
> An: 'x3d public mailing list' <x3d-public at web3d.org>
> Betreff: [X3D-Public] Dragging things in screen-space
>
> Does anyone know of a way to drag something (like using a
> PlaneSensor)
> such that the result is being able to drag an object in the plane of the
> screen, no matter the orientation?
>
> I would have thought putting a drag sensor into a billboard
> (camera-facing) would get me close, but it's got problems. So I'm
> looking for a script or proto that can accomplish this. Or any tips on
> extensions like Device or Mouse sensor. Any platform, any player. Thanks
>
> Dave A.
>
> _______________________________________________
> X3D-Public mailing list
> X3D-Public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
--
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!
Jetzt informieren: http://www.gmx.net/de/go/freephone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20111024/b65f511c/attachment.html>
More information about the X3D-Public
mailing list