POV-Ray : Newsgroups : povray.binaries.animations : Pigment-mapped Bouncing Ball ... (DIVX5.02 AVI, 313KB) : Re: Pigment-mapped Bouncing Ball ... (DIVX5.02 AVI, 313KB) Server Time
19 Jul 2024 09:15:56 EDT (-0400)
  Re: Pigment-mapped Bouncing Ball ... (DIVX5.02 AVI, 313KB)  
From: Michael Andrews
Date: 25 Feb 2003 07:07:00
Message: <3e5b5c64$1@news.povray.org>
Hi Tor Olav,

Tor Olav Kristensen wrote:
> Here is a slightly modified version of that macro:
> 
> 
> #macro ThreePoint_Trans(pA1, pB1, pC1, pA2, pB2, pC2)
> 
>   #local vY1 = vnormalize(pB1 - pA1);
>   #local vZ1 = vnormalize(vcross(pC1 - pA1, vY1));
>   #local vX1 = vcross(vZ1, vY1);
>   #local T1 = transform { Matrix_Trans(vX1, vY1, vZ1, pA1) inverse }
>   #local vY2 = vnormalize(pB2 - pA2);
>   #local vZ2 = vnormalize(vcross(pC2 - pA2, vY2));
>   #local vX2 = vcross(vZ2, vY2);
>   #local T2 = transform { Matrix_Trans(vX2, vY2, vZ2, pA2) }
> 
>   transform { T1 T2 }
> 
> #end // macro ThreePoint_Trans
>  
> 
> Tor Olav

Nice. I used the Shear_Trans() macro because that's what the 
Point_At_Trans() macro used, I didn't think to use the Matrix_Trans() to 
do the shear and translate in one go. Kudos to you :-)

Bye for now,
	Mike Andrews.


Post a reply to this message

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