rotX,rotY,rotZ to transform a Cylinder

C

Carsten Marx

Hello,
for an expert in Java3D this might be an easy question. For me, novice,
it's driving me nuts...

Problem:

I have a StartPoint (sx,sy,sz) and a EndPoint (ex,ey,ez).
- I've created a Clylinder with some standard radius and the distance
between the two points as lenght.
- I've translated the Cylinder with Transform3D.setTranslation to the
right position.
- Now i want to rotate the Cylinder around the X,Y,Z axis to 'connect'
the two points withe the Cylinder.
For this rotation i need the angles to rotate and the way how (and in
which order) i must apply the rotations and translations....

Anybody out there whi has done this? Is not well documentated...

Please help me!!!

Thanks and best regards....

Carsten
 
E

Eric Sosman

Carsten Marx wrote On 07/25/06 11:20,:
Hello,
for an expert in Java3D this might be an easy question. For me, novice,
it's driving me nuts...

Problem:

I have a StartPoint (sx,sy,sz) and a EndPoint (ex,ey,ez).
- I've created a Clylinder with some standard radius and the distance
between the two points as lenght.
- I've translated the Cylinder with Transform3D.setTranslation to the
right position.
- Now i want to rotate the Cylinder around the X,Y,Z axis to 'connect'
the two points withe the Cylinder.
For this rotation i need the angles to rotate and the way how (and in
which order) i must apply the rotations and translations....

Anybody out there whi has done this? Is not well documentated...

Easier method: First rotate the cylinder until its
axis is parallel to the desired line, then translate the
rotated cylinder.

In general, it is easier to understand rotations and
scalings relative to the origin. If you have an object
centered at (x,y,z) and you want to rotate or shrink or
expand it "in place," first translate by (-x,-y,-z) to
move it to the origin, then apply the rotations and scale
factors, and finally translate by (+x,+y,+z) to return to
the original position. This produces the same transformation
matrix (so there is no worry about inefficiency from the
"extra" translations), but is much easier to understand
and to program.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Optimization by hand. 5
creating EPS with Python 3

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top