POV-Ray : Newsgroups : povray.advanced-users : vector.x is a float, isn't it? : Re: vector.x is a float, isn't it? Server Time
3 Jul 2024 04:53:05 EDT (-0400)
  Re: vector.x is a float, isn't it?  
From: Mike Williams
Date: 15 Jul 2008 01:37:09
Message: <uwTQ+EB2cDfIFwU5@econym.demon.co.uk>
Wasn't it slehar who wrote:
>"Chris B" <nom### [at] nomailcom> wrote:
>> "slehar" <sle### [at] gmailcom> wrote in message
>> news:web.487a73ecc7f877ecf75a90cb0@news.povray.org...
>>
>> #declare myVector = <1,2>;
>> #debug concat("myAngle: ", str(atan2(myVector.y,myVector.x),3,3),"\n")
>>
>> writes "myAngle: 1.107" into the message stream for me on 3.6 under Windows.
>> What version are you running?
>>
>> Regards,
>> Chris B.
>
>Wow, thats bizarre! That code works for me too! But when I put the atan2( ) in
>the density function where I need it, it doesn't work!

The problem isn't the atan2(), you can't mention vectors inside a 
function. You can so this:

#declare mX = myVector.x;
#declare mY = myVector.y;

...
   function {
     ... atan2(mX,mY) ...
   }

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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