POV-Ray : Newsgroups : povray.general : 4.0 Feature discussion : Re: 4.0 Feature discussion Server Time
9 Aug 2024 11:24:05 EDT (-0400)
  Re: 4.0 Feature discussion  
From: ingo
Date: 16 Nov 2000 12:37:56
Message: <8FEEB05EAseed7@povray.org>
The reason for using Python as an example is that it is the only language 
I can use a bit (and like) and it seems to run on all platforms POV runs 
on. I don't intend to promote it as the ultimate solution for  3D-OO. 
Others may be more suitable, Ocaml? Perl? Squeak?

Chris Huff wrote:

>So you can have a language designed for the purpose of describing
>scenes and without the "baggage" from languages designed for other
>purposes (text processing, application development, web applets,
>etc...).
 
You can strip out all/most of what you don't need from the Python 
distribution.
The available of all kinds modules when using an existing language can 
quite an advantage though. A bit cumbersome, but you could build a scene 
that traces the latest news of this server.

>Things like vectors, colors, textures, and shapes as part of
>the language instead of classes in a library for the language, etc.

Doesn't a library or module become part of the language? Big parts of 
Python are written in Python.
Mmm, what is "the language", everything in the distribution, or only the 
part that needs no modules to be imported?

>A language designed for scene description can be simplified and easier 
>to learn, as well as better for hand-coding scenes. Also, you can make 
>it completely platform independant without having to pound someone 
>else's source into submission. :-)
>

Sorry Chris, but I don't understand the last part of this (lack of idiom 
on my side).

>A library for another language that outputs .pov files or tells POV to 
>render a scene would still be very useful, it just has some
>shortcomings for writing scenes...

No need to write scene files, it could interact directly with the render 
engine.
An other example, the lightflow rendering interface, with or without 
Python wrapping.

>>..
>I will look at these... I haven't really liked what I have seen of 
>Python, at least not for POV. For instance: the animation of a ball 
>bouncing on a box uses this code(some indentation added):
>
>from visual import *
>
>floor = box (pos=(0,0,0), length=4, height=0.5, width=4, 
>color=color.blue)
>ball = sphere (pos=(0,4,0), radius=1, color=color.red)
>ball.velocity = vector(0,-1,0)
>dt = 0.01
>
>while 1:
>    rate (100)
>    ball.pos = ball.pos + ball.velocity*dt
>    if ball.y < ball.radius:
>        ball.velocity.y = -ball.velocity.y
>    else:
>        ball.velocity.y = ball.velocity.y - 9.8*dt

For the first part, that's a design decision, it could also have been:
floor=box((-2,-0.25,-2),(2,0.25,2),(0,0,1))
ball=sphere((0,4,0),1,(1,0,0))

>I can't imagine many POV users being happy programming scenes like
>this, though some specific things would be useful in a scene
>description language.

Just like most POV users won't be happy with any OO-POV. It's different.

>Oh, and I didn't cut off the end...but the lack
>of some kind of end to the while loop makes me nervous.

That is what I like about Python, no ;#{} , why should I think of those? I 
have a computer for that. And if you're used to indent, you won't have a 
problem with white space being meaningfull.


Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

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