POV-Ray : Newsgroups : povray.general : Rotations... : Re: Rotations... Server Time
7 Aug 2024 17:22:53 EDT (-0400)
  Re: Rotations...  
From: Ben Chambers
Date: 6 Aug 2001 23:58:06
Message: <3b6f674e@news.povray.org>
"Margus Ramst" <mar### [at] peakeduee> wrote in message
news:3B6F2C11.A54195C8@peak.edu.ee...
> Not sure what you need, but you might want to try John VanSickle's
> Reorient macro:
>
> #macro Reorient(Axis1,Axis2)
>         #local vX1=vnormalize(Axis1);
>         #local vX2=vnormalize(Axis2);
>         #local vY=vnormalize(vcross(vX1,vX2));
>         #local vZ1=vnormalize(vcross(vX1,vY));
>         #local vZ2=vnormalize(vcross(vX2,vY));
>         matrix < vX1.x, vY.x,vZ1.x, vX1.y,vY.y,vZ1.y, vX1.z,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 >
> #end

Hmm... neat, but I can't seem to make it work...
Ok, I have here an object:

sphere {
 0,1
 scale <5,1,5>
}

I also have three points on a plane (lets call them
p1,p2,p3).  I'd like to have this flattened sphere
oriented on the plane...  Maybe I'm just braindead
tonight, but the reorient macro didn't do it for
me...

Thanks in advance...

...Chambers


Post a reply to this message

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