Mailing List Archive

povray.py
Has anyone created a pov ray module for python?

Thanks,
Tom
povray.py [ In reply to ]
"TM" <downstairs@home.com> writes:

> Has anyone created a pov ray module for python?

I have been thinking about it, but haven't done it yet... What do you
think it should contain?

>
> Thanks,
> Tom

--

Magnus
Lie
Hetland http://arcadia.laiv.org <arcadia@laiv.org>
povray.py [ In reply to ]
mlh@idt.ntnu.no (Magnus L. Hetland) writes:

-> "TM" <downstairs@home.com> writes:
->
-> > Has anyone created a pov ray module for python?
->
-> I have been thinking about it, but haven't done it yet... What do you
-> think it should contain?

This is a relatively off the cuff response. But I think such a module
should provide python classes for the POV types. Then, instead of
using the POV scene description language, you would use Python. You
could algorithmicly create a scene or animation sequence. Then you
would pass the data structure (a list or other sequence) to a Python
function that renders it in POV scene description language for POV to
digest and render.

Another thing I would like to see is a module for generating RIB
files. In fact, a Python RenderMan module would be quite nice,
complete with shading language support. Anything out there like that?

--
David Steuber
http://www.david-steuber.com

s/trashcan/david/ to reply by mail
If you don't, I won't see it.
povray.py [ In reply to ]
On 6 Apr 1999, David Steuber wrote:

> mlh@idt.ntnu.no (Magnus L. Hetland) writes:
>
> -> "TM" <downstairs@home.com> writes:
> ->
> -> > Has anyone created a pov ray module for python?
> ->
> -> I have been thinking about it, but haven't done it yet... What do you
> -> think it should contain?
>
> This is a relatively off the cuff response. But I think such a module
> should provide python classes for the POV types. Then, instead of
> using the POV scene description language, you would use Python. You
> could algorithmicly create a scene or animation sequence. Then you
> would pass the data structure (a list or other sequence) to a Python
> function that renders it in POV scene description language for POV to
> digest and render.

neat! does it have a documented API? I downloaded the source and
browsed it for a bit, and don't see any specific extension api.. if
there isnt one and you're not familiar with the code it would be tough
to deal with... Are there any similar bindings for other languages
that you could use for inspiration?

>
> Another thing I would like to see is a module for generating RIB
> files. In fact, a Python RenderMan module would be quite nice,
> complete with shading language support. Anything out there like that?

There is one of those, by Ture Palsson, I dont know how complete it
is, see http://www.lysator.liu.se/~ture/terry.html for info.

-dave
povray.py [ In reply to ]
On 06 Apr 1999 15:46:12 -0500, David Steuber <trashcan@david-steuber.com> wrote:
>mlh@idt.ntnu.no (Magnus L. Hetland) writes:
>
>-> "TM" <downstairs@home.com> writes:
>->
>-> > Has anyone created a pov ray module for python?
>->
>-> I have been thinking about it, but haven't done it yet... What do you
>-> think it should contain?
>
>This is a relatively off the cuff response. But I think such a module
>should provide python classes for the POV types. Then, instead of
>using the POV scene description language, you would use Python. You
>could algorithmicly create a scene or animation sequence. Then you
>would pass the data structure (a list or other sequence) to a Python
>function that renders it in POV scene description language for POV to
>digest and render.
>
>Another thing I would like to see is a module for generating RIB
>files. In fact, a Python RenderMan module would be quite nice,
>complete with shading language support. Anything out there like that?
>
>--
>David Steuber
>http://www.david-steuber.com
>
>s/trashcan/david/ to reply by mail
>If you don't, I won't see it.
povray.py [ In reply to ]
On 06 Apr 1999 15:46:12 -0500, David Steuber <trashcan@david-steuber.com> wrote:
>mlh@idt.ntnu.no (Magnus L. Hetland) writes:
>
>-> "TM" <downstairs@home.com> writes:
>->
>-> > Has anyone created a pov ray module for python?
>->
>-> I have been thinking about it, but haven't done it yet... What do you
>-> think it should contain?
>
>This is a relatively off the cuff response. But I think such a module
>should provide python classes for the POV types. Then, instead of
>using the POV scene description language, you would use Python. You
>could algorithmicly create a scene or animation sequence. Then you
>would pass the data structure (a list or other sequence) to a Python
>function that renders it in POV scene description language for POV to
>digest and render.
>
>Another thing I would like to see is a module for generating RIB
>files. In fact, a Python RenderMan module would be quite nice,
>complete with shading language support. Anything out there like that?

Well, I don't have RenderMan, but I did write a pov.py module. It does
basically what you described, and eventually I'm going to add animation
features and basic physics (the ocaml module I wrote before did that) and
stuff like "magic" transforms that align one object with another, spline
curves etc. I've designed some scenes in it, and it's wordier than pov, but
has all the benefits of a real language. It doesn't do the new halo syntax
because the pov people have yet to release an updated unix version
(grumblegripegrunt). It's incomplete, and written when I was first learning
python, and I haven't worked on it for a while, but I'll send it to anyone
interested. Perhaps we could collaborate?
povray.py [ In reply to ]
quinn@cruzeiro.ugcs.caltech.edu (Quinn Dunkan) writes:

-> (grumblegripegrunt). It's incomplete, and written when I was first learning
-> python, and I haven't worked on it for a while, but I'll send it to anyone
-> interested. Perhaps we could collaborate?

I'd love too except that I am so new to Python that I haven't written
anything in it yet.

I was going to have a go at reproducing the functionality of
leafnode.

--
David Steuber
http://www.david-steuber.com

s/trashcan/david/ to reply by mail
If you don't, I won't see it.

As long as the answer is right, who cares if the question is wrong?
povray.py [ In reply to ]
Dave Mitchell <davem@magnet.com> writes:

-> neat! does it have a documented API? I downloaded the source and
-> browsed it for a bit, and don't see any specific extension api.. if
-> there isnt one and you're not familiar with the code it would be tough
-> to deal with... Are there any similar bindings for other languages
-> that you could use for inspiration?

If you are talking about the POV-Ray scene description language, it is
documented in the POV distribution. All that is needed is to generate
the POV sdl based on the computational results from Python, or any
other scripting language or programming language for that matter.

--
David Steuber
http://www.david-steuber.com

s/trashcan/david/ to reply by mail
If you don't, I won't see it.

As long as the answer is right, who cares if the question is wrong?
povray.py [ In reply to ]
I would love a copy. I've only written a few (simple) modules,
but I'd sure like to try and help you out.

Please let me know where I can download it or send it to my
other e-mail address: mrfusion@home.com

Thanks!
Tom

P.S. By the way, there is a module called terry that generates renderman
code.
I think they even list it on python.org. What I'd REALLY rather see is a
module
that could manipulate pre generated .rib files. God that would make my life
easier......


> Well, I don't have RenderMan, but I did write a pov.py module. It does
> basically what you described, and eventually I'm going to add animation
> features and basic physics (the ocaml module I wrote before did that) and
> stuff like "magic" transforms that align one object with another, spline
> curves etc. I've designed some scenes in it, and it's wordier than pov,
but
> has all the benefits of a real language. It doesn't do the new halo
syntax
> because the pov people have yet to release an updated unix version
> (grumblegripegrunt). It's incomplete, and written when I was first
learning
> python, and I haven't worked on it for a while, but I'll send it to anyone
> interested. Perhaps we could collaborate?
povray.py [ In reply to ]
"TM" <downstairs@home.com> writes:

> P.S. By the way, there is a module called terry that generates renderman
> code.

Well, sort of. It needs to be linked with a library that implements
the RenderMan C API. I wrote terry a couple of years ago when my own
RenderMan hack didn't have a RIB parser and I was sick and tired of
having to recompile C programs to make test images. I haven't used it
very much since I got a RIB parser working, and as far as I know,
noone else has used it, either.

If someone actually _is_ using it, let me know, and I might get around
to release the few bug fixes and improvments that are sitting around
in my CVS repository. :-)

-- Ture
povray.py [ In reply to ]
TM says:
>I would love a copy. I've only written a few (simple) modules,
>but I'd sure like to try and help you out.
>

Second that. Perhaps it would be easier putting it on a web/ftp site.

marduk@python.net


--
----------------------------------------------------------------
(c) Copywight 1992 Elmer Fudd. All wights wesewved.
povray.py [ In reply to ]
Quinn Dunkan wrote:
> Well, I don't have RenderMan, but I did write a pov.py module. It does
> basically what you described, and eventually I'm going to add animation
> features and basic physics (the ocaml module I wrote before did that) and
> stuff like "magic" transforms that align one object with another, spline
> curves etc. I've designed some scenes in it, and it's wordier than pov, but
> has all the benefits of a real language. It doesn't do the new halo syntax
> because the pov people have yet to release an updated unix version
> (grumblegripegrunt). It's incomplete, and written when I was first learning
> python, and I haven't worked on it for a while, but I'll send it to anyone
> interested. Perhaps we could collaborate?

I'd like a copy of your pov.py module, please. I'm an experienced Python
programmer, and raytracing hobbyist. If I made any additions to it, I'd gladly
send them along to you.
Thanks!
Mordy
--
o Mordy Ovits
o Cryptographic Engineer
o LockStar Inc.
---------------------------------------------------------------------------
#!/usr/local/bin/python
from sys import*;from string import*;a=argv;[s,p,q]=filter(lambda x:x[:1]!=
'-',a);d='-d'in a;e,n=atol(p,16),atol(q,16);l=(len(q)+1)/2;o,inb=l-d,l-1+d
while s:s=stdin.read(inb);s and map(stdout.write,map(lambda i,b=pow(reduce(
lambda x,y:(x<<8L)+y,map(ord,s)),e,n):chr(b>>8*i&255),range(o-1,-1,-1)))
povray.py [ In reply to ]
On 09 Apr 1999 09:07:30 PDT, Mordy Ovits <movits@lockstar.com> wrote:
>Quinn Dunkan wrote:
>> Well, I don't have RenderMan, but I did write a pov.py module. It does
>> basically what you described, and eventually I'm going to add animation
>> features and basic physics (the ocaml module I wrote before did that) and
>> stuff like "magic" transforms that align one object with another, spline
>> curves etc. I've designed some scenes in it, and it's wordier than pov, but
>> has all the benefits of a real language. It doesn't do the new halo syntax
>> because the pov people have yet to release an updated unix version
>> (grumblegripegrunt). It's incomplete, and written when I was first learning
>> python, and I haven't worked on it for a while, but I'll send it to anyone
>> interested. Perhaps we could collaborate?
>
>I'd like a copy of your pov.py module, please. I'm an experienced Python
>programmer, and raytracing hobbyist. If I made any additions to it, I'd gladly
>send them along to you.
>Thanks!
>Mordy

pov.py v0.0:
http://www.calarts.edu/~elaforge/pov/

I guess it's released now :)

Also, the pov people just released pov 3.1e for linux, so what I said before
is no longer accurate.
povray.py [ In reply to ]
In article <slrn7gsick.14q.quinn@necro.ugcs.caltech.edu>, Quinn Dunkan
<quinn@necro.ugcs.caltech.edu> wrote:

> pov.py v0.0:
> http://www.calarts.edu/~elaforge/pov/
>
> I guess it's released now :)

Cool! Looks very neat. I'm not quite clear on how you're planning to
handle animations. Will your Python script spit out a different
POV-Ray script for each time point? Or will it spit out a whole series
of them? Some things, like flocking behavior, are really hard to
implement in a clock-independent way.

Also, I see matrix transforms are on your to-do list. I suggest you
use the Numeric module. Use dot(m1,m2) or dot(m1,v) to combine
matrices or apply a transformation matrix to a vector, respectively.

Cheers,
-- Joe

--
,------------------------------------------------------------------.
| Joseph J. Strout Biocomputing -- The Salk Institute |
| joe@strout.net http://www.strout.net |
`------------------------------------------------------------------'
Check out the Mac Web Directory! http://www.strout.net/macweb.cgi
povray.py [ In reply to ]
On Fri, 09 Apr 1999 13:48:46 -0700, Joe Strout <joe@strout.net> wrote:
>In article <slrn7gsick.14q.quinn@necro.ugcs.caltech.edu>, Quinn Dunkan
><quinn@necro.ugcs.caltech.edu> wrote:
>
>> pov.py v0.0:
>> http://www.calarts.edu/~elaforge/pov/
>>
>> I guess it's released now :)
>
>Cool! Looks very neat. I'm not quite clear on how you're planning to
>handle animations. Will your Python script spit out a different
>POV-Ray script for each time point? Or will it spit out a whole series
>of them? Some things, like flocking behavior, are really hard to
>implement in a clock-independent way.

Um, I guess I'm not understanding what you mean... "will it spit out a bunch of
pov scripts or will it spit out a bunch of pov scripts?" Er, yes :) (different
script for each time point). I see no reason to use pov's animation features
(clock, etc) we can do all that from python better. One of my original
frustrations with animation under pov was that you couldn't keep a state
between frames. While it's an elegant approach in theory, I don't want to do
calculus to drop a ball, and huge #case #range etc. to have it bounce :) So I
think my approach to clock independence would be to have stateful objects that
when you tell them advance time_interval they modify their velocity and advance
themselves. Pre-Newtonian physics, I guess, but I'm still a physics idiot :)
I'm sure someone more math-minded than myself could come up with some cool
ideas / code.

>Also, I see matrix transforms are on your to-do list. I suggest you
>use the Numeric module. Use dot(m1,m2) or dot(m1,v) to combine
>matrices or apply a transformation matrix to a vector, respectively.

Hmm... I'd rather not require external packages if it can be avoided. If
the matrix stuff is trivial, I'll reinvent it. But it's a good idea to look
at NumPy anyway because there's probably some stuff in there that will be
useful in other ways too. I've already made my own vectors, but it was a
Learning Experience :)


BTW, the initial release had some minor code rot that made it non-functional
(transforms in the wrong place, etc.) but I replaced it pretty quickly.