I tried the following
 
Cylinder cylinder=new Cylinder();
 
 cylinder.setAppearance(app);
 
 
 Transform3D t2 = new Transform3D();
   Vector3d vec = new Vector3d(-3.0d, -1.0d,-2.0d);
   Matrix3f matrix=new Matrix3f();
   matrix.set(new AxisAngle4d(vec,40d));
   matrix.setIdentity();
   t2.set(matrix);
   
   TransformGroup objTrans2 = new TransformGroup();
   objTrans2.setTransform(t2);
   objTrans2.addChild(cylinder); 
 
group.addChild(objTrans2);
 
 
But i cannot orientate the cylinder towards (-3.0, -1.0,-2.0). What is wrong?
 
----- Original Message -----
From: Zak Nixon
Sent: Friday, June 20, 2003 9:15 PM
Subject: Re: [JAVA3D] Rotate a Cylinder within the x,y,z axis

I have a method that calculates a rotation matrix that will do what you need. If you want me to send it to you , I will....
 
Zak
----- Original Message -----
Sent: Friday, June 20, 2003 12:57 PM
Subject: [JAVA3D] Rotate a Cylinder within the x,y,z axis

I have a Cylinder that starts from a P1(x1,y1,z1) so i want to rotate and the other edge to be located by another point P2(x2.y2.z2) adjusting its height in order to reach the second point
 
Thanks in advance

Reply via email to