Use 2 different TransformGroups: TG1 -- TG2 -- Shape3D (TG2 is child of TG1and
Shape3D is child of TG2)
Use TG1 for positioning the cylinder and TG2 for the rotation around the
cylinder axes (Y axis). The compound transformation will be rendered, with TG2
as the first transformation followed by TG1.

Srinivas Reddy schrieb:

> 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".

===========================================================================
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".

Reply via email to