You have a problem with setting the angles. In your sequence:

          Rot.rotX(angleX);
          Rot.rotY(angleY);
          Rot.rotZ(angleZ);

Rot will contain only the last call, since each rotN will *replace* the
previous one. They are not cumulative !

You should use setEuler instead.

Cheers,

Florin

-----Urspr�ngliche Nachricht-----
Von: Naveen Babu Chikkala [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 20. Juni 2003 00:40
An: [EMAIL PROTECTED]
Betreff: [JAVA3D] problem in angle setting in java 3D using Transform3D


hello
 i am facing some problem like angle seting with x y z planes . my basic
problem is "I NEED TO PLOTE A CYLINDER IN  X Y Z PLANE with some dynamic
anggles "

i am using below  code
           Transform3D t3d = new Transform3D();

 this t3d set to mid point of cylinder

          Transform3D Rot = new Transform3D();
          Rot.rotX(angleX);
          Rot.rotY(angleY);
          Rot.rotZ(angleZ);
          Rot.mul(t3d);

angleX,angleY,angleZ are the method for calculating angle with respectx y z
lines
method look like this


-----------------
public double getAngleWithX_Axis(Point3f p1,Point3f p2)
  {
  Point3f p1_l=p1;
  Point3f p2_l=p2;

  float x1=0.0f;
  float y1=0.0f;
  float z1=0.0f;

  float x2=2.0f;
  float y2=0.0f;
  float z2=0.0f;
//---second line
/*
            p2
     |---------------
     |
  p1 |
     |
*/
  float x3=p1_l.x;
  float y3=p1_l.y;
  float z3=p1_l.z;

  float x4=p2_l.x;
  float y4=p2_l.y;
  float z4=p2_l.z;

  double a0,a1,b0,b1,c0,c1;
  a0=x2-x1;b0=y2-y1;c0=z2-z1;
  a1=x4-x3;b1=y4-y3;c1=z4-z3;

  double firstSqure= Math.sqrt(((a0*a0)+(b0*b0)+(c0*c0)));// p1
  double secondSqure= Math.sqrt(((a1*a1)+(b1*b1)+(c1*c1)));//p2
  double sum=((a0*a1)+(b0*b1)+(c0*c1))/((firstSqure)*(secondSqure));
  double theta=Math.acos(sum);
   return theta;
  }
-----------------
i don't know where the problem in  in my angle calculation  or in my java3d
implementation.

waiting for feedback

Regards

naveen

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