|
![](/i/fill.gif) |
Thanks for your answer Tor, i use vrotate ans Vangle to attache my cylinder
at they extremity. When i use VDangle, cylinders are not attached. Then i
dont rotate my cylinder but i take the point Np0 and add it a random vector
in the +y direction to make my tree grow.
Its my firt macro in that way and i am now blocked because i cant translate
and rotate an object along and around cylinders.
My way to place cylinders is certenly the most rational way but it's the
onely one i found.
message de news: 417eea64$1@news.povray.org...
> sap wrote:
>> Hello;
>>
>> I have made a tree macro and would like to add leaf on my tree. You can
>> see the result in the p.b.i.
> ...
>> #local ang=VAngle(p0,p1);
>> #local Np0=vrotate(p1,ang);
> ...
>
> I have not looked at all of your code, but I spotted this:
>
> In the code above you calculate an angle and then you rotate
> a vector around all the x, y and z axes.
>
> Is this intentionally ?
>
> Note that:
>
> vrotate(p1, ang)
>
> evaluates to:
>
> vrotate(p1, <ang, ang, ang>)
>
> or equivalently:
>
> vrotate(p1, ang*x + ang*y + ang*z)
>
> I.e. the p1 vector is first rotated around the x-axis, then
> around the y-axis and finally around the z-axis.
>
> Also: vrotate() expects its 2nd argument to be a vector with
> components in degrees, while the angle returned from the
> VAngle() macro is in radians.
>
> (The VAngleD() macro will return an angle in degrees.)
>
>
> You may want to read these sections once more:
>
> http://www.povray.org/documentation/view/3.6.1/459/
> ---> 2.7.9.2 Vector functions and macros
>
> http://www.povray.org/documentation/view/3.6.1/229/
> ---> 2.2.1.4.5 Functions
>
>
> Also note that there is a built in function; vaxis_rotate(),
> which will rotate a vector around an arbitrary vector.
>
> --
> Tor Olav
> http://subcube.net
> http://subcube.com
Post a reply to this message
|
![](/i/fill.gif) |