POV-Ray : Newsgroups : povray.binaries.images : Odd Transformation Server Time
15 Nov 2024 08:21:35 EST (-0500)
  Odd Transformation (Message 1 to 5 of 5)  
From: Ghost
Subject: Odd Transformation
Date: 16 Jul 2003 09:33:12
Message: <3F1553EE.ED12B0C7@duratechindustries.net>
Hi all.  Can someone help me understand why my translated and rotated
grass would suddenly become airborne?  According to the Pov code, there
is no transformation on the y-axis, and I don't ever rotate it upwards
or downwards, either.  Attached is the picture and below is the
pertinent code for the grass circle.

#declare Rad=10;
#declare R_V=0;
#declare R3 = seed (27143);
#declare R4 = seed (R3);
#declare Offset1=-67+rand(R2)*6.357;

#while(Rad > 0)
  #local R_V = 0;
  #while(R_V<360)
    object{ Blade
      translate rand(R4)*1.5+z*Rad
      rotate y*R_V
    }
    #local R_V = R_V+300/Rad/10;
  #end
  #local Rad = Rad - 0.5;
#end


Post a reply to this message


Attachments:
Download 'gardenborder.jpg' (51 KB)

Preview of image 'gardenborder.jpg'
gardenborder.jpg


 

From: Gilles Tran
Subject: Re: Odd Transformation
Date: 16 Jul 2003 09:41:55
Message: <3f155623$1@news.povray.org>

3F1553EE.ED12B0C7@duratechindustries.net...
> Hi all.  Can someone help me understand why my translated and rotated
> grass would suddenly become airborne?


In the following line
> translate rand(R4)*1.5+z*Rad

rand(R4)*1.5 is actually promoted to rand(R4)*1.5*<1,1,1>
so that you have a random <x,y,z> movement
To get it right it should be for instance <rand(R4),0,rand(R4)>


G.


**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters


Post a reply to this message

From: ABX
Subject: Re: Odd Transformation
Date: 16 Jul 2003 09:42:46
Message: <iclahv828bjo9tkrmgk2cefgf93bcb9sb5@4ax.com>
On Wed, 16 Jul 2003 08:32:30 -0500, Ghost <flu### [at] duratechindustriesnet> wrote:

>      translate rand(R4)*1.5+z*Rad

this line means in fact

       #local temp=rand(R4);
       translate <temp,temp,temp>*1.5+z*Rad

which means
       
       #local temp=rand(R4);
       translate <temp*1.5,temp*1.5,temp*1.5+Rad>*1.5

so as you seen there is translation along y axis.

ABX


Post a reply to this message

From: fitchn
Subject: Re: Odd Transformation
Date: 16 Jul 2003 09:45:01
Message: <web.3f15568047a69323397cf110@news.povray.org>
Ghost wrote:
>Hi all.  Can someone help me understand why my translated and rotated
>grass would suddenly become airborne?  According to the Pov code, there
>is no transformation on the y-axis, and I don't ever rotate it upwards
>or downwards, either.  Attached is the picture and below is the
>pertinent code for the grass circle.

Actually, you are translating the grass in the y-direction, right here:

>    object{ Blade
>      translate rand(R4)*1.5+z*Rad
>      rotate y*R_V
>    }

the statement:

  translate rand(R4)*1.5+z*Rad

will be promoted to:

  translate <rand(R4)*1.5, rand(R4)*1.5, rand(R4)*1.5+Rad>

with the rand statements all being equal. You need to explicitly set the
direction that you want this translation to occur. Hope that helps!

 - Nick (FitchN.com)


Post a reply to this message

From: Ghost
Subject: Re: Odd Transformation
Date: 16 Jul 2003 10:49:55
Message: <3F1565EE.9BD902D8@duratechindustries.net>
Ack... now I see what I did.  I guess it never occurred to me that this would
happen.  Oh well, now I know!    Thanks guys!

Ghost wrote:

> Hi all.  Can someone help me understand why my translated and rotated
> grass would suddenly become airborne?  According to the Pov code, there
> is no transformation on the y-axis, and I don't ever rotate it upwards
> or downwards, either.  Attached is the picture and below is the
> pertinent code for the grass circle.
>
> #declare Rad=10;
> #declare R_V=0;
> #declare R3 = seed (27143);
> #declare R4 = seed (R3);
> #declare Offset1=-67+rand(R2)*6.357;
>
> #while(Rad > 0)
>   #local R_V = 0;
>   #while(R_V<360)
>     object{ Blade
>       translate rand(R4)*1.5+z*Rad
>       rotate y*R_V
>     }
>     #local R_V = R_V+300/Rad/10;
>   #end
>   #local Rad = Rad - 0.5;
> #end
>
>   ------------------------------------------------------------------------
>  [Image]


Post a reply to this message

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