POV-Ray : Newsgroups : povray.bugreports : text directive + vstr =3D garbled Server Time
22 Dec 2024 12:35:58 EST (-0500)
  text directive + vstr =3D garbled (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Bald Eagle
Subject: text directive + vstr =3D garbled
Date: 31 Jul 2013 16:35:01
Message: <web.51f974c6197c318773fc9ebb0@news.povray.org>
I tried a lot of things to output scene data into the scene itself.
All the numbers seemed all bunched up on top of one another.
Changed sclae, spacing, font, etc.
tried vstr(3, vector...) as well as str(vector.x [or .y or .z]) but to no avail.
POV-Ray 3.6 on Winbloze.


Post a reply to this message

From: clipka
Subject: Re: text directive + vstr =3D garbled
Date: 1 Aug 2013 02:09:35
Message: <51f9fb9f$1@news.povray.org>
Am 31.07.2013 22:34, schrieb Bald Eagle:
>
> I tried a lot of things to output scene data into the scene itself.
> All the numbers seemed all bunched up on top of one another.
> Changed sclae, spacing, font, etc.
> tried vstr(3, vector...) as well as str(vector.x [or .y or .z]) but to no avail.
> POV-Ray 3.6 on Winbloze.

If you use multiple text objects for that purpose, make sure that you 
translate them to different places in the scene. POV-Ray does /not/ do 
that automatically for you.


Post a reply to this message

From: Bald Eagle
Subject: Re: text directive + vstr =3D3D garbled
Date: 1 Aug 2013 11:35:00
Message: <web.51fa7f8e7cfa019573fc9ebb0@news.povray.org>
I did do that.
I found it quite convenient to declare a variable for the y-coordinate and then
subtract the scaled text size from it after every line of text.  Then all I had
to do was copy and paste both lines, which gave me all the text syntax I needed,
plus the "carriage return".

The problem is, even if I output a single variable to the screen, its value is
all bunched up on itself what appears to be horizontally.
I say appears to be, because when I started spacing the text and scaling it, I
got a weird effect where it appeared to increase the y-position as the text went
across the screen. - not a variable thing, because it all happened from text
contained inside a single concat directive.

Puzzling.


Post a reply to this message

From: clipka
Subject: Re: text directive + vstr =3D3D garbled
Date: 1 Aug 2013 13:46:28
Message: <51fa9ef4@news.povray.org>
Am 01.08.2013 17:32, schrieb Bald Eagle:
> I did do that.
> I found it quite convenient to declare a variable for the y-coordinate and then
> subtract the scaled text size from it after every line of text.  Then all I had
> to do was copy and paste both lines, which gave me all the text syntax I needed,
> plus the "carriage return".
>
> The problem is, even if I output a single variable to the screen, its value is
> all bunched up on itself what appears to be horizontally.
> I say appears to be, because when I started spacing the text and scaling it, I
> got a weird effect where it appeared to increase the y-position as the text went
> across the screen. - not a variable thing, because it all happened from text
> contained inside a single concat directive.
>
> Puzzling.

Sounds like a non-zero "offset" parameter to me; that would also explain 
the text piling up on itself.

Did you perhaps set the "offset" parameter to a (non-zero) scalar (i.e. 
a single number)? The parameter is actually a vector, so POV-Ray will 
promote any scalar value to <1,1,1>*NUMBER, while <1,0,0>*NUMBER (i.e. 
x*NUMBER) is what users will typically want (if they bother about this 
parameter at all; usually a value of 0 will do just fine).


Post a reply to this message

From: Bald Eagle
Subject: Re: text directive + vstr =3D3D3D garbled
Date: 2 Aug 2013 00:45:07
Message: <web.51fb392f509ddb473fc9ebb0@news.povray.org>
I'm pretty sure the offset was zero, though I've played with that parameter
before, and haven't had any problems.

(I was trying different fonts.
I don't know WHERE or exactly how to define my font directory, and
of course Windows has spaces in the path for my fonts - how do I include those?)

Putting other variables into the exact same text directive that were not derived
from vectors worked just fine, so I'm pretty sure it's something wacky with
vstr() rather than text().


Post a reply to this message

From: clipka
Subject: Re: text directive + vstr =3D3D3D garbled
Date: 2 Aug 2013 01:31:49
Message: <51fb4445@news.povray.org>
Am 02.08.2013 06:44, schrieb Bald Eagle:
> I'm pretty sure the offset was zero, though I've played with that parameter
> before, and haven't had any problems.
>
> (I was trying different fonts.
> I don't know WHERE or exactly how to define my font directory, and
> of course Windows has spaces in the path for my fonts - how do I include those?)

Placing them in double quotes I guess.

> Putting other variables into the exact same text directive that were not derived
> from vectors worked just fine, so I'm pretty sure it's something wacky with
> vstr() rather than text().

I very much doubt that; strings are strings, whether from literals or 
generated by string functions. I suggest you post your code.


Post a reply to this message

From: Bald Eagle
Subject: Re: text directive + vstr =3D3D3D3D garbled
Date: 3 Aug 2013 13:10:01
Message: <web.51fd390f6f32f5b73fc9ebb0@news.povray.org>
> > I don't know WHERE or exactly how to define my font directory, and
> > of course Windows has spaces in the path for my fonts - how do I include those?)

More explicitly - what file do I alter to have the library path include that
directory?


> I very much doubt that; strings are strings, whether from literals or
> generated by string functions. I suggest you post your code.

I obliterated the original code, but something new I'm working on has PART of
the same problem.  I can now see that vstr is not the problem - it's how I'm
placing the text with translate (and possibly rotate) in the original.

Nothing like simple Cartesian coordinates to make me feel like a simpleton.

text {ttf "arial.ttf", concat("(",vstr(3, Center2, ",", 0, 0),")"), 0.1, 0 scale
0.2 translate (x*X2)+0.2 pigment { color Green}}


Post a reply to this message

From: James Holsenback
Subject: Re: text directive + vstr =3D3D3D3D garbled
Date: 3 Aug 2013 13:41:44
Message: <51fd40d8$1@news.povray.org>
On 08/03/2013 01:08 PM, Bald Eagle wrote:
>
>>> I don't know WHERE or exactly how to define my font directory, and
>>> of course Windows has spaces in the path for my fonts - how do I include those?)
>
> More explicitly - what file do I alter to have the library path include that
> directory?

you can do it from the command line:
http://wiki.povray.org/content/Reference:Scene_Parsing_Options#Library_Paths

or edit: your local povray.ini file

... and possibly (I don't use windows version) the windows gui allows on 
the fly additions as well

PS: I know the documentation /can/ be fairly dry reading, but it's all 
in there ;-)


Post a reply to this message

From: clipka
Subject: Re: text directive + vstr =3D3D3D3D garbled
Date: 3 Aug 2013 16:54:42
Message: <51fd6e12@news.povray.org>
Am 03.08.2013 19:08, schrieb Bald Eagle:

> text {ttf "arial.ttf", concat("(",vstr(3, Center2, ",", 0, 0),")"), 0.1, 0 scale
> 0.2 translate (x*X2)+0.2 pigment { color Green}}

Is it intentional that you translate by 0.2 in /all/ three dimensions 
(in addition to translating by X2 along the x axis)?


Post a reply to this message

From: Bald Eagle
Subject: Re: text directive + vstr =3D3D3D3D3D garbled
Date: 3 Aug 2013 17:50:01
Message: <web.51fd7a8d8ca650b273fc9ebb0@news.povray.org>
> > 0.2 translate (x*X2)+0.2 pigment { color Green}}
>
> Is it intentional that you translate by 0.2 in /all/ three dimensions
> (in addition to translating by X2 along the x axis)?

No.  So I guess I need to do x*(X2+0.2)
I've always found the translate syntax confusing because my brain wants to
multiply the present X location by the float, instead of adding it like what
actually happens.   Grrrr.


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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