POV-Ray : Newsgroups : povray.advanced-users : Shear_Trans usage? Server Time
23 Dec 2024 18:30:49 EST (-0500)
  Shear_Trans usage? (Message 1 to 5 of 5)  
From: Jim Charter
Subject: Shear_Trans usage?
Date: 18 Jan 2010 18:36:42
Message: <4b54f08a@news.povray.org>
Can anyone show me proper usage of the Shear_Trans macro.

This is a modification I made to the "Basic Scene" supplied on the 
insert menu.  Can't get it to parse.

#local A=<1,2,3>;
#local B=<1,2,3>;
#local C=<1,2,3>;
sphere {
   0.0, 1
   Shear_Trans(A,B,C)
   texture {
     pigment {
       radial
       frequency 8
       color_map {
         [0.00 color rgb <1.0,0.4,0.2> ]
         [0.33 color rgb <0.2,0.4,1.0> ]
         [0.66 color rgb <0.4,1.0,0.2> ]
         [1.00 color rgb <1.0,0.4,0.2> ]
       }
     }
     finish{
       specular 0.6
     }
   }
}


Post a reply to this message

From: StephenS
Subject: Re: Shear_Trans usage?
Date: 18 Jan 2010 20:20:01
Message: <web.4b550848adbc88f57d31a1620@news.povray.org>
Jim Charter <jrc### [at] msncom> wrote:
> Can anyone show me proper usage of the Shear_Trans macro.
>
> This is a modification I made to the "Basic Scene" supplied on the
> insert menu.  Can't get it to parse.
>
> #local A=<1,2,3>;
> #local B=<1,2,3>;
> #local C=<1,2,3>;
> sphere {
>    0.0, 1
>    Shear_Trans(A,B,C)
>    texture {
>      pigment {
>        radial
>        frequency 8
>        color_map {
>          [0.00 color rgb <1.0,0.4,0.2> ]
>          [0.33 color rgb <0.2,0.4,1.0> ]
>          [0.66 color rgb <0.4,1.0,0.2> ]
>          [1.00 color rgb <1.0,0.4,0.2> ]
>        }
>      }
>      finish{
>        specular 0.6
>      }
>    }
> }

Try:

#include "transforms.inc"
camera {translate<0,0,-5>}
#local A=<1,2,3>;
#local B=<1,1,3>;
#local C=<1,2,1>;
sphere {
   0.0, 1
   Shear_Trans(A,B,C)
   texture {
     pigment {
       radial
       frequency 8
       color_map {
         [0.00 color rgb <1.0,0.4,0.2> ]
         [0.33 color rgb <0.2,0.4,1.0> ]
         [0.66 color rgb <0.4,1.0,0.2> ]
         [1.00 color rgb <1.0,0.4,0.2> ]
       }
     }
     finish{
       specular 0.6
     }
   }
}

Stephen S


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Shear_Trans usage?
Date: 18 Jan 2010 20:35:00
Message: <web.4b550b4eadbc88f5d6291f840@news.povray.org>
Jim Charter <jrc### [at] msncom> wrote:
> Can anyone show me proper usage of the Shear_Trans macro.
>
> This is a modification I made to the "Basic Scene" supplied on the
> insert menu.  Can't get it to parse.
>
> #local A=<1,2,3>;
> #local B=<1,2,3>;
> #local C=<1,2,3>;
....
>    Shear_Trans(A,B,C)
....

Hi Jim,

You have to make sure that no two of those three vectors are parallel.

I.e.: These three conditions have to be met:

vlength(vcross(A, B)) > 0
vlength(vcross(B, C)) > 0
vlength(vcross(C, A)) > 0

(Note that there are also other ways to check for parallel vectors.)

--
Tor Olav
http://subcube.com


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Shear_Trans usage?
Date: 18 Jan 2010 20:50:01
Message: <web.4b550e9eadbc88f5d6291f840@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> Jim Charter <jrc### [at] msncom> wrote:
> > Can anyone show me proper usage of the Shear_Trans macro.
> >
> > This is a modification I made to the "Basic Scene" supplied on the
> > insert menu.  Can't get it to parse.
> >
> > #local A=<1,2,3>;
> > #local B=<1,2,3>;
> > #local C=<1,2,3>;
> ....
> >    Shear_Trans(A,B,C)
> ....
>
> Hi Jim,
>
> You have to make sure that no two of those three vectors are parallel.
>
> I.e.: These three conditions have to be met:
>
> vlength(vcross(A, B)) > 0
> vlength(vcross(B, C)) > 0
> vlength(vcross(C, A)) > 0
>
> (Note that there are also other ways to check for parallel vectors.)

I think the most elegant way is to use the scalar triple product:

vdot(A, vcross(B, C)) != 0

See:
http://en.wikipedia.org/wiki/Triple_product

--
Tor Olav
http://subcube.com


Post a reply to this message

From: Jim Charter
Subject: Re: Shear_Trans usage?
Date: 18 Jan 2010 20:57:23
Message: <4b551183$1@news.povray.org>
Tor Olav Kristensen wrote:
> "Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
>> Jim Charter <jrc### [at] msncom> wrote:
>>> Can anyone show me proper usage of the Shear_Trans macro.
>>>
>>> This is a modification I made to the "Basic Scene" supplied on the
>>> insert menu.  Can't get it to parse.
>>>
>>> #local A=<1,2,3>;
>>> #local B=<1,2,3>;
>>> #local C=<1,2,3>;
>> ....
>>>    Shear_Trans(A,B,C)
>> ....
>>
>> Hi Jim,
>>
>> You have to make sure that no two of those three vectors are parallel.
>>
>> I.e.: These three conditions have to be met:
>>
>> vlength(vcross(A, B)) > 0
>> vlength(vcross(B, C)) > 0
>> vlength(vcross(C, A)) > 0
>>
>> (Note that there are also other ways to check for parallel vectors.)
> 
> I think the most elegant way is to use the scalar triple product:
> 
> vdot(A, vcross(B, C)) != 0
> 
> See:
> http://en.wikipedia.org/wiki/Triple_product
> 
> --
> Tor Olav
> http://subcube.com
> 
> 
> 
> 

Yes that *is* elegant.  Thank you, and Stephen


Post a reply to this message

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