user2939415
user2939415

Reputation: 894

X3DOM: Drag to Resize Box

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?

Upvotes: 0

Views: 255

Answers (1)

Traian
Traian

Reputation: 3003

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

Upvotes: 1

Related Questions