Hi, Welcome to this mailing list :)  

 

   If you want to work independently with your knob beside your other objects, you should isolate it in a Group;

   easily, construct and temporary group and add your Shape3D to it and then add the group to the parent group;

   I believe you should code your own mouse behavior for your task; so, you can control every mouse event easily.

   e.g, when a mouse dragging happens, you can use a PickObject to locate the nearest object to the mouse pointer

   and if the picked object was your knob group, you could do whatever you want (rotate it, and change the value of a variable)

   to find out if the selected object is your knob group, you can set the userData of your knob group to an object (works as a flag) in the

   construction time; so, you can easily get the userData of the selected object and see if it is the knob's or not.

   I can suggest you to review the codes of FourByFour demo application, PickMouseBehavior and PickRotateBehavior.

   They are all distributed with Java3D API :)

 

   Sincerely,

   Mehrtash

 

  Srinivas Reddy <[EMAIL PROTECTED]> wrote:

Hello all,

This is the first time I am contributing to the Java
3D email archive.

I have created multiple objects in my 3D world. One of
the objects is a cylinder. When it is added to the 3D
world, it is vertical and it lies on the Y axis. Then
I rotate it using the following code so that it is on
the Z axis (pointing towards the viewer).

(knobSpace).getTransform(knobTranslate);
Matrix3d someRotationMatrix = new Matrix3d();
someRotationMatrix.setIdentity();
someRotationMatrix.rotX(Math.PI/2.0);

knobTranslate.setRotation(someRotationMatrix);
(knobSpace).setTransform(knobTranslate);

What I would like to do now: turn the cylinder like a
knob (example: volume control on your music sound
system). Using PickMouseBehavior, I am able to rotate
the knob based on a mouse click (this implies that I
am able to pick detect which object is picked). What I
really would like to do is to do this based on mouse
drag. The volume control can be either decreased or
increased.

Can anyone give me ideas on how to accomplish this
task? This rotation of the volume control must be
independent of other objects in the scene.

Thanks,

-Sri :)

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".



Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

Reply via email to