X3DOM: Drag to Resize Box

264 Views Asked by At

I would like create a box in X3DOM in the following manner:

Y an Z position and size are fixed. X position and size is user-defined.

  1. User presses mouse button to place one side of the box.
  2. User drags to set the x-size.
  3. User releases to finish.

Here is how it should look:

http://filebox.vt.edu/users/sharni/Other/Clipboard03.png

Any thoughts on what a way of doing this would be?

1

There are 1 best solutions below

0
On

you can define an object in your scene which would act like a fake plan. Then the mouseover event will give you the mouse coordinates (relative to your fake plan). You start drawing your object when you click the fake plan and you increase the size of it while onmouseover, clicked and dragging. Of course the fake plan (e.g. a rectangle, or even a plane - don't know if you have it in X3Dom) should not be visible.

http://x3dom.org/x3dom/test/functional/geoPrimitives.xhtml