POV-Ray : Newsgroups : povray.general : Like flower turn to the sun : Re: Like flower turn to the sun Server Time
29 Jul 2024 06:18:47 EDT (-0400)
  Re: Like flower turn to the sun  
From: Thomas de Groot
Date: 2 Dec 2012 03:01:51
Message: <50bb0aef$1@news.povray.org>
On 1-12-2012 16:14, Albun wrote:
> ;-) The Sun don't shining enought to turn flower.
>
> 1)I don't understand how calculate distance, without move directly to the
> array_point that i have.
> There is VDist(V1,V2), but what else with angle VAngleD(V1,V2)?
>
> 2)In my exemple the Sun, not origin, is at <3,0,54>.
> With "transform.inc", i adjust code like that after translate with the forth.
> but no result.
>

You have always to work from the origin and translate to the correct 
position later. Here is an example:

//Use of Point_At_Trans:
#declare Cyl =
union {
   cylinder { <0, 0, 0>, <0, 1, 0>, 0.05
     pigment {color rgb <1, 0, 0>}
   }
   sphere {0, 0.15 pigment {rgb <0, 1, 0>}}
}

#declare TargetObj =  sphere {0, 0.15 pigment {rgb <1, 1, 1>}}

//points at Target
#declare Target = <0, 1.5, 10>;
#declare CylPos = <1, 0, 1>;
#declare YAxis  = Target - CylPos;

object {Cyl
   Point_At_Trans(YAxis)
   translate CylPos
}

object {TargetObj translate Target}



Thomas


Post a reply to this message

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