POV-Ray : Newsgroups : povray.general : Text String to Vector. Server Time
25 Dec 2024 09:00:11 EST (-0500)
  Text String to Vector. (Message 1 to 3 of 3)  
From: Stephen
Subject: Text String to Vector.
Date: 4 Jan 2014 16:15:39
Message: <52c879fb$1@news.povray.org>
I've looked but cannot find the answer. :-)

How can I convert a text string in the form of "<x,y,z>" to a vector 
that I can use as a camera position?


-- 
Regards
     Stephen


Post a reply to this message

From: clipka
Subject: Re: Text String to Vector.
Date: 4 Jan 2014 17:03:53
Message: <52c88549$1@news.povray.org>
Am 04.01.2014 22:15, schrieb Stephen:
> I've looked but cannot find the answer. :-)
>
> How can I convert a text string in the form of "<x,y,z>" to a vector
> that I can use as a camera position?

#include "strings.inc"
#declare MyString = "<3.3, 6, 2>";
#declare MyVector = Parse_String(MyString);

Alternatively you could write the string to a temporary file (using the 
#fopen, #write and #fclose directives) and include it, but as a matter 
of fact that's exactly what Parse_String does.


Post a reply to this message

From: Stephen
Subject: Re: Text String to Vector.
Date: 4 Jan 2014 18:37:12
Message: <52c89b28$1@news.povray.org>
On 04/01/2014 10:03 PM, clipka wrote:
> #declare MyVector = Parse_String(MyString);

Thanks, my brain is dead.

I had problems with <0,0,0> at first.

Now other problems to work out.

-- 
Regards
     Stephen


Post a reply to this message

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