Greetings, Naveen,
Just to save the big guns from sending this out, I'll offer that one
problem right off the bat is that your series of rotations
Rot.rotX(angleX);
Rot.rotY(angleY);
Rot.rotZ(angleZ);
results in only Rot.rotZ(angleZ) being the net effect. This is because each
call to .rot#() wipes out the previous contents of the Transform. You'll
have to do something else, such as create a separate Transform3D to hold a
new rotation and multiply it in, but there are many other solutions.
It's a problem that I found out about the hard way, too, and, to me, it's
not blatantly obvious from the documentation.
Regards,
c h e t !
--- Naveen Babu Chikkala <[EMAIL PROTECTED]> wrote:
> 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".