POV-Ray : Newsgroups : povray.binaries.images : Reading in code line by line? Server Time
30 Jul 2024 12:28:01 EDT (-0400)
  Reading in code line by line? (Message 1 to 9 of 9)  
From: Jörg 'Yadgar' Bleimann
Subject: Reading in code line by line?
Date: 17 Dec 2011 02:38:39
Message: <4eec46ff@news.povray.org>
High!

As I announced recently, I would like to add a code display feature to 
my includes presentation table (see attachment). So I would like to know 
whether it is possible to read ASCII text line by line via #read... the 
manual says data to be read in have to be separated by commas. The other 
way would be to explicitly store the whole text "manually" into an array 
whose contents then are rendered in the display section of the table's 
glass lid... but this appears rather clumsy to me!

And, concerning the rendering of the test version - why is the red 
transparent text not completely cast as shadow?

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download '2011-12-17 includes showroom 1, take 92 - display table.jpg' (74 KB)

Preview of image '2011-12-17 includes showroom 1, take 92 - display table.jpg'
2011-12-17 includes showroom 1, take 92 - display table.jpg


 

From: Thomas de Groot
Subject: Re: Reading in code line by line?
Date: 17 Dec 2011 07:42:36
Message: <4eec8e3c$1@news.povray.org>

> High!
>
> As I announced recently, I would like to add a code display feature to
> my includes presentation table (see attachment). So I would like to know
> whether it is possible to read ASCII text line by line via #read... the
> manual says data to be read in have to be separated by commas. The other
> way would be to explicitly store the whole text "manually" into an array
> whose contents then are rendered in the display section of the table's
> glass lid... but this appears rather clumsy to me!

Yes, that is possible indeed. Write a file with each text item separated 
by commas (and I think they also should be within " ", not sure 
however), then read the file using:

   #while (defined(your text file))
     #read (....)
     ....
   #end

and apply each read text item to where/what you intend. Reading will 
automatically stop when reaching the end of the file.

>
> And, concerning the rendering of the test version - why is the red
> transparent text not completely cast as shadow?
>
I cannot tell just from the image unfortunately.

Thomas


Post a reply to this message

From: Thomas de Groot
Subject: Re: Reading in code line by line?
Date: 17 Dec 2011 07:47:14
Message: <4eec8f52$1@news.povray.org>
On 17-12-2011 13:42, Thomas de Groot wrote:

> #while (defined(your text file))
> #read (....)
> ....
> #end
>
> and apply each read text item to where/what you intend. Reading will
> automatically stop when reaching the end of the file.
>

I probably should have written this better as:

  #while (defined(your text file))
  #read (....)
    ....
    apply each read text item to where/what you intend. Reading will
    automatically stop when reaching the end of the file.
    ....
  #end



Thomas


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Reading in code line by line?
Date: 17 Dec 2011 13:10:33
Message: <4eecdb19$1@news.povray.org>
High!

On 17.12.2011 13:42, Thomas de Groot wrote:

> Yes, that is possible indeed. Write a file with each text item separated
> by commas (and I think they also should be within " ", not sure
> however), then read the file using:

As the file to read the data from is the original stones1.inc file, it 
probaby would be better to write a C++ program which reads in the text 
line-wise, generates PoV-Ray array definition code from these lines and 
then stores it under "stones1_inc.inc"!

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Reading in code line by line?
Date: 18 Dec 2011 19:47:19
Message: <4eee8997@news.povray.org>
Hi(gh)!



> As the file to read the data from is the original stones1.inc file, it
> probaby would be better to write a C++ program which reads in the text
> line-wise, generates PoV-Ray array definition code from these lines and
> then stores it under "stones1_inc.inc"!

I've done so... see my recent entry on povray.programming!

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Reading in code line by line?
Date: 18 Dec 2011 19:49:03
Message: <4eee89ff@news.povray.org>
Hi(gh)!

Oh, yes, and here an example:


Post a reply to this message


Attachments:
Download '2011-12-19 includes showroom 1, take 94 - display table.jpg' (51 KB)

Preview of image '2011-12-19 includes showroom 1, take 94 - display table.jpg'
2011-12-19 includes showroom 1, take 94 - display table.jpg


 

From: clipka
Subject: Re: Reading in code line by line?
Date: 19 Dec 2011 19:49:39
Message: <4eefdba3$1@news.povray.org>


> And, concerning the rendering of the test version - why is the red
> transparent text not completely cast as shadow?

Because you accidently told POV-Ray to render it this way? :-P

I can't tell what's wrong without seeing the code. Maybe you set 
no_shadow on that text without noticing?


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Emitting media problem (Re: Reading in code line by line?)
Date: 22 Dec 2011 01:57:17
Message: <4ef2d4cd$1@news.povray.org>
Hi(gh)!

After I got together the text array, I wonder whether it is possible to 
have the display elements in a glowing emitting media with does not fade 
to invisible against a white background... as want to use radiosity 
later on, just using ambient 1 would be useless!

See you in Khyberspace!

Yadgar


Post a reply to this message

From: clipka
Subject: Re: Emitting media problem (Re: Reading in code line by line?)
Date: 22 Dec 2011 08:54:50
Message: <4ef336aa@news.povray.org>

> Hi(gh)!
>
> After I got together the text array, I wonder whether it is possible to
> have the display elements in a glowing emitting media with does not fade
> to invisible against a white background... as want to use radiosity
> later on, just using ambient 1 would be useless!

Purely emitting media /always/ fades to invisible against a white 
background (unless you're rendering to a high dynamic range file format, 
i.e. HDR or openEXR).


Post a reply to this message

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