POV-Ray : Newsgroups : povray.animations : Rotating and moving a cyl to AB : Rotating and moving a cyl to AB Server Time
19 May 2024 10:49:43 EDT (-0400)
  Rotating and moving a cyl to AB  
From: MichaelC
Date: 20 Dec 2006 17:35:00
Message: <web.4589b8fc47905c5f4599c17c0@news.povray.org>
Hello everyone,

I've got 2 changing points in space, A and B.  I want to construct and
texture a cylindrical type object at 0 and then move it between A and B
(using A and B as its endpoints).   Point A will never equal point B but
their relation to each other can be anything.  Either point can be in any
quadrant.  Later A and B could even swap positions.

I can already determine the length of AB and construct my cylinder at
y*-Len/2 to y*Len/2. I can translate it to the correct location using the
midpoint of my cyl (0) to the midpoint of AB. I have graphed the normal of
AB at the origin which seems to match a dummy cylinder drawn at AB. I
cannot however get the correct rotation at the origin before my translation

I've spent hours reviewing Calc, Trig and Vectors but was never an Ace at
any of them.  I've attempted calculating "theta and phi" then later "pitch
and yaw" using a different method and have applied multiple combinations of
rotate commands using their values.  I have then tried using vcross, vdot
and then vaxis-rotate but to no avail .... I've tried to compensate for the
difference in the y and z axis from my old math books but may have missed
something there.  I'm beginning to feel ... well ... discouraged.

Is there an easy trick to this?

Thanks in advance,
Michael


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.