POV-Ray : Newsgroups : povray.general : POV 4 ideology proposal : Re: POV 4 ideology proposal Server Time
26 Sep 2024 17:44:36 EDT (-0400)
  Re: POV 4 ideology proposal  
From: Nathan Kopp
Date: 14 Apr 1999 01:24:22
Message: <3714179E.FD5B68E9@Kopp.com>
For all of you who dislike the concept of object oriened POV script, I think
one thing should be clarified.  At least some of us are proposting a semi-
object oriented language... where we implement the encapsulation and (in a 
wierd way) inheritence, but NOT data hiding.  That means you can access
parts of an object but you don't have to do so through methods.

The main reason I want to do this is because I think that for POV go get
better for animation, it needs to be able to do an entire animation from
a single script WITHOUT RE-PARSING BETWEEN FRAMES!!!!!

How would this look?

-----------------
#declare myCam = camera{...}

#include "big_tree_macro_takes_forever_to_parse.inc"

#declare myTree = object{MakeTree() translate ...}

#declare fr=0;
#while (fr<10)
  myCam.translate <...>        // translate acts like a method
  #declare myCam.angle = ...;  // angle acts like a property
  
  clearFrame()    // special function that clears all objects from scene

  global_settings{...} // global settings for this frame

  // now we put our objects in the scene
  camera{ myCam }   // use the new camera settings
  object{ myTree }  // and no need to re-parse the tree

  // now we render
  RenderFrame(fr)  // a special function that renders the frame (filename
                   // based on the parameter

  #declare fr=fr+1;
#end

--------------------

Now, I want to make a comment about that statement were translate acted like
a method.  You see, in some ways I'm beginning to think that POV should
follow the same ideology as Perl.  The April 1999 Communications of the ACM
has a great article by Larry Wall (original author of Perl) called "The
Origin of the Camel Lot in the Breakdown of the Bilingual Unix".

The article talkes about the Perl community (which reminded me much of the
POV community).  Larry Wall also talked about how Perl was designed to be
a language like a human spoken/written language... one that is kind of
ad-hoc and NOT minimalistic like so many other languages.

A quote from the article: "People who hype orthogonality should be
sentanced to draw everything with an Etch-a-Sketch."

I found the article very enlightening, since I have in the past been
pro-minimalistic, thinking a grand-unified-appoach would be best.
So, maybe we should let the POV scripting language evolve in a way that,
as somebody else mentioned, makes sense to the humans, and then we'll
force the computer to understand.  ;-)

In a previous post I mentioned that I would appreciate a re-write of the POV
language... but as I've thought about it more, the POV scene description
languate is pretty good... some of the things that have been suggested
would actually be going BACK to POV version 1.0 syntax... it must have
been changed for a reason (because people didn't like it the old way).

I've done quite a bit of programming inside POV, and it is really
relatively easy to add functionality to POV.  Adding new keywords to
the parser is really simple, IMHO.  Adding new objects is also
relatively easy (and orthogonal... yes, I still have quite a bit of OO
blood in me).

Adding the photon map was alot easier that many of you probably think it
was.  It required very localized changes to the core of POV.  And I
really doubt if the photon mapping could have been implemented via a
plug-in of any sort unless someone had thought of it when designing the
plug-in interface.

Well, that's my current thoughts on the topic.

One last thing... I really don't like typing #declare... I've got some
ideas on how to 'fix' this, but they should go in a different thread.

-Nathan


Post a reply to this message

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