POV-Ray : Newsgroups : povray.general : POV to Indigo Using File IO Server Time
31 Jul 2024 00:27:47 EDT (-0400)
  POV to Indigo Using File IO (Message 1 to 5 of 5)  
From: Dave Dunn
Subject: POV to Indigo Using File IO
Date: 6 May 2008 09:05:00
Message: <web.4820568fc0fadd51653c34500@news.povray.org>
I just got a copy of Indigo, which seems to be a pretty good renderer. The
problem is the XML coding language. I was wondering, before I make the effort,
if anyone has looked into using the POV File IO feature (or otherwise) to
convert between them. If not, I'll give it a whack and let you know how it
works.


Post a reply to this message

From: Charles C
Subject: Re: POV to Indigo Using File IO
Date: 7 May 2008 00:54:53
Message: <4821361d@news.povray.org>
Dave Dunn wrote:
> I just got a copy of Indigo, which seems to be a pretty good renderer. The
> problem is the XML coding language. I was wondering, before I make the effort,
> if anyone has looked into using the POV File IO feature (or otherwise) to
> convert between them. If not, I'll give it a whack and let you know how it
> works.
> 
> 

Keep in mind you're somewhat limited by the fact that the "I" in "IO" 
requires comma-separated values.
Charles


Post a reply to this message

From: Dave Dunn
Subject: Re: POV to Indigo Using File IO
Date: 7 May 2008 07:10:00
Message: <web.48218d2f759ee343f5e89fed0@news.povray.org>
Charles C <"nospam a nospam.com"> wrote:

> Keep in mind you're somewhat limited by the fact that the "I" in "IO"
> requires comma-separated values.
> Charles

Yeah, it was just a random thought until I started looking at the code and saw
the challenges. The best that could happen, short of a .NET application or
something, would be a set of macros, one for each object type, that would allow
you to set parameters, render to POV and then #write the XML as string data to a
file. Probably more trouble than it's worth at this point.

I don't have time to look up the #write syntax and haven't used it in like five
years, so don't laugh, but here is the conceptual part:

#macro Sphere (Location, Radius Texture)

sphere {Location,Radius,
texture {Texture}}

#write filename
"<sphere>
<material_name>"Texture"</material_name>
<center>" Location "</center>
<radius>" Radius "</radius>
</sphere>"
#end
#end


Post a reply to this message

From: Jan Dvorak
Subject: Re: POV to Indigo Using File IO
Date: 7 May 2008 08:51:37
Message: <4821a5d9$1@news.povray.org>
Dave Dunn napsal(a):
> Charles C <"nospam a nospam.com"> wrote:
> 
>> Keep in mind you're somewhat limited by the fact that the "I" in "IO"
>> requires comma-separated values.
>> Charles
> 
> Yeah, it was just a random thought until I started looking at the code and saw
> the challenges. The best that could happen, short of a .NET application or
> something, would be a set of macros, one for each object type, that would allow
> you to set parameters, render to POV and then #write the XML as string data to a
> file. Probably more trouble than it's worth at this point.
> 
> I don't have time to look up the #write syntax and haven't used it in like five
> years, so don't laugh, but here is the conceptual part:
> 
> #macro Sphere (Location, Radius Texture)
> 
> sphere {Location,Radius,
> texture {Texture}}
> 
> #write filename
> "<sphere>
> <material_name>"Texture"</material_name>
> <center>" Location "</center>
> <radius>" Radius "</radius>
> </sphere>"
> #end
> #end
> 
> 
> 
> 
you will have to output the strings one by one or use concatenate(...). 
Pov-ray does not support implicit concatenation (unlike PHP).

-- 
the ultimate time-killer:
+a0.0 +am2 +r9

Johnny D


Post a reply to this message

From: Dave Dunn
Subject: Re: POV to Indigo Using File IO
Date: 7 May 2008 13:15:00
Message: <web.4821e25c759ee3438465caf0@news.povray.org>
/* This will at least create a correct Indigo sphere definition :) Note that the
color name in the macro is in quotes. This is because Indigo requires a name for
its materials. I could have used a dummy, but what the heck. */

#version 3.6;
#include "colors.inc"

camera {
  location  <0, .5, -4>
  look_at   0
}

light_source {
  <0, 10, -20>
  color White
}

#macro Sphere (X,Y,Z, Radius, Pigment,R,G,B)

sphere {
<X,Y,Z>,
Radius
pigment {rgb <R,G,B>}
}

#fopen File "Testfile.txt" write
#write ( File,
"<sphere>
<material> <name>", Pigment,"</name>
<diffuse>
<colour>",R,",",G,",",B,"</colour>
</diffuse>
</material>
<center>", ,X,",",Y,",",Z, "</center>
<radius>",Radius,"</radius>
</sphere>")

#end

Sphere (0,0,0,1,"Red",1,0,0)


Post a reply to this message

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