POV-Ray : Newsgroups : povray.beta-test : Axis_Rotate_Trans : Re: Axis_Rotate_Trans Server Time
30 Jul 2024 02:23:44 EDT (-0400)
  Re: Axis_Rotate_Trans  
From: Rune
Date: 18 Jan 2002 06:47:25
Message: <3c480b4d@news.povray.org>
"mm" wrote:
> macro Axis_Rotate_Trans bugs on Axis = <-1, 1, -1> : singular matrix
> The reason why is clear from the text : local vY and vZ are then null.

> I found no better way around that to test for the singular case.

Thanks for your efforts, but I'm going to use a different approach. The
current Axis_Rotate_Trans is written in a somewhat clumsy way, which also,
as you have shown, can cause errors. Unless anyone objects, I'm going to
replace it with the much cleaner approach below. I have no idea why the
original macro was written the way it was, instead of this simple way, but
if anyone know of any catches to the new approach, please let me know.

//rotate around a specific axis
#macro Axis_Rotate_Trans(Axis, Angle)
    #local vX = vaxis_rotate(x,Axis,Angle);
    #local vY = vaxis_rotate(y,Axis,Angle);
    #local vZ = vaxis_rotate(z,Axis,Angle);
    transform {
        matrix < vX.x,vX.y,vX.z, vY.x,vY.y,vY.z, vZ.x,vZ.y,vZ.z, 0,0,0 >
    }
#end

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated Jan 2)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

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