POV-Ray : Newsgroups : povray.newusers : Newbie error or beta bug? Server Time
6 Sep 2024 12:12:35 EDT (-0400)
  Newbie error or beta bug? (Message 1 to 3 of 3)  
From: Brett Kugler
Subject: Newbie error or beta bug?
Date: 19 Aug 1998 01:56:55
Message: <01bdcb2e$3058c4e0$603488cf@w003132.airmail.net>
Using the unions declared below, the translate's of the form

translate *x *y *z

work as expected, however, the

translate <x y z>

does not translate correctly in the -z direction, instead it acts like a -y
translate.

Any answers to why this might be happening?
Thanks in advance,
Brett

<code snippet>
#declare wing_bone = union
{
cylinder {  < 0, -6.0, -1.5>,  < 0, -4.0, -0.5>, 0.2 }
cylinder {  < 0, -4.0, -0.5>,  < 0, -2.0, -0.0>, 0.2 }
cylinder {  < 0, -2.0,  0.0>,  < 0,  2.0,  0.0>, 0.2 }
cylinder {  < 0,  2.0, -0.0>,  < 0,  4.0, -0.5>, 0.2 }
cylinder {  < 0,  4.0, -0.5>,  < 0,  6.0, -1.5>, 0.2 }
}

#declare wing = union
{
 object { wing_bone scale <1.0 0.4 1.0> translate -6*x -3.0*z }
 object { wing_bone scale <1.0 0.6 1.0> translate -4*x -2.0*z }
 object { wing_bone scale <1.0 0.8 1.0> translate -2*x -1.0*z }
 object { wing_bone scale <1.0 1.0 1.0> }
 object { wing_bone scale <1.0 0.8 1.0> translate  2*x -1.0*z }

//object{wing_bone scale <1.0 0.4 1.0> translate <-6.0 0.0 -3.0>}
//object{wing_bone scale <1.0 0.6 1.0> translate <-4.0 0.0 -2.0>}
//object{wing_bone scale <1.0 0.8 1.0> translate <-2.0 0.0 -1.0>}
//object{wing_bone scale <1.0 1.0 1.0> translate < 0.0 0.0  0.0>}
//object{wing_bone scale <1.0 0.8 1.0> translate < 2.0 0.0 -1.0>}
}   

object { wing texture { pigment { color White } } }               
<end code snip>


Post a reply to this message

From: K  Tyler
Subject: Re: Newbie error or beta bug?
Date: 19 Aug 1998 02:06:35
Message: <35DA4EF3.DD16D1C6@pacbell.net>
Brett Kugler wrote:

> Using the unions declared below, the translate's of the form
> translate *x *y *z work as expected, however, the
> translate <x y z>
> does not translate correctly in the -z direction, instead it acts like a -y
> translate.
> Any answers to why this might be happening?
> Thanks in advance, Brett
>

It will work correctly if you add the changes I made below.The way you are doing
it makes the transform wok in an additive evaluation.
You need instead for each to be evaluated on an individual basis. See below -->

> <code snippet>
> #declare wing_bone = union
> {
> cylinder {  < 0, -6.0, -1.5>,  < 0, -4.0, -0.5>, 0.2 }
> cylinder {  < 0, -4.0, -0.5>,  < 0, -2.0, -0.0>, 0.2 }
> cylinder {  < 0, -2.0,  0.0>,  < 0,  2.0,  0.0>, 0.2 }
> cylinder {  < 0,  2.0, -0.0>,  < 0,  4.0, -0.5>, 0.2 }
> cylinder {  < 0,  4.0, -0.5>,  < 0,  6.0, -1.5>, 0.2 }
> }
>
> #declare wing = union
> {
>

These

>  object { wing_bone scale <1.0 0.4 1.0> translate -6*x  translate -3.0*z }
>  object { wing_bone scale <1.0 0.6 1.0> translate -4*x translate -2.0*z }
>  object { wing_bone scale <1.0 0.8 1.0> translate -2*x translate -1.0*z }
>  object { wing_bone scale <1.0 1.0 1.0> }
>  object { wing_bone scale <1.0 0.8 1.0> translate  2*x translate -1.0*z }
>
>

now = These -->

> //object{wing_bone scale <1.0 0.4 1.0> translate <-6.0 0.0 -3.0>}
> //object{wing_bone scale <1.0 0.6 1.0> translate <-4.0 0.0 -2.0>}
> //object{wing_bone scale <1.0 0.8 1.0> translate <-2.0 0.0 -1.0>}
> //object{wing_bone scale <1.0 1.0 1.0> translate < 0.0 0.0  0.0>}
> //object{wing_bone scale <1.0 0.8 1.0> translate < 2.0 0.0 -1.0>}
> }
>
> object { wing texture { pigment { color White } } }
> <end code snip>

  K.Tyler


Post a reply to this message

From: Ron Parker
Subject: Re: Newbie error or beta bug?
Date: 19 Aug 1998 10:23:50
Message: <35dad1e6.0@news.povray.org>
On 19 Aug 1998 00:56:55 -0500, Brett Kugler 
        <w00### [at] mailairmailnet> wrote:

>translate <x y z>
>
>does not translate correctly in the -z direction, instead it acts like a -y
>translate.

>//object{wing_bone scale <1.0 0.4 1.0> translate <-6.0 0.0 -3.0>}

The problem here is that POV can't tell whether to parse "0.0 -3.0" as 
"0.0-3.0" or "0.0, -3.0" and it chooses the former.  Really old versions of
POV supported vectors without commas, and the current version continues to
attempt to support them for backward compatibility, but for all new code, 
you should use commas inside vectors.


Post a reply to this message

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