POV-Ray : Newsgroups : povray.binaries.utilities : Re: Q: Cylinder caculus? : Re: Q: Cylinder caculus? Server Time
8 Jul 2024 17:32:21 EDT (-0400)
  Re: Q: Cylinder caculus?  
From: Ron Parker
Date: 10 Nov 1998 08:40:03
Message: <36484233.0@news.povray.org>
On Mon, 09 Nov 1998 22:56:09 -0500, Greg M. Johnson <@aol.com> wrote:
>Thanks, but that web server for twyst's macro station now appears to be
>down. Could you post that tiny little macro here?

I can't get there either; Twyst has a broken CGI script.  Here's an
adaptation of the code, as seen in my rounded cylinder macro.  I've
changed all the 3.1-specific stuff to 3.02 stuff, so you can just
put this in an .inc file.  #declare Orientation to be your desired
vector, include this, then use transform{trans} where you'd usually
use rotate.  This assumes you used x as the original axis.

  #declare vX2=vnormalize(Orientation);
  #declare vY=vnormalize(vcross(x,vX2));
  #declare vZ1=vnormalize(vcross(x,vY));
  #declare vZ2=vnormalize(vcross(vX2,vY));
    
  #declare trans=transform {
    matrix < 1, vY.x,vZ1.x, 0,vY.y,vZ1.y, 0,vY.z, vZ1.z, 0,0,0 >
    matrix < vX2.x,vX2.y,vX2.z,  vY.x,vY.y, vY.z, vZ2.x,vZ2.y,vZ2.z, 0,0,0 >
  }


Post a reply to this message

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