 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Greg M. Johnson" wrote:
> isosurface{
> function{y/290+noise3d(x*0.05,y**0.05,z**0.05)}
> accuracy 0.01
> threshold .21
> contained_by {sphere{0,100}}
> pigment{SeaGreen}
> finish{ambient 0.1}
> }
In case anyone wanted to try this at home, there's a typo above. What I literally
did was this:
#declare fnoise=.05;
#declare MyObject=
isosurface{
function{y/290+
noise3d(x*fnoise,y*fnoise,z*fnoise)/1
}
accuracy 0.01
threshold .21
contained_by {
sphere{0,100}
}
pigment{SeaGreen}
finish{ambient 0.1}
}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Why not support a Perl based scene building language? Maybe a filter which
spits out POV from Perl code... :)
Warp wrote:
> "Modules" could be better.
>
> As I have already said elsewhere, programming languages using modules
> but
> which are not OO languages (such as Modula2) support structures that look
> a lot like object-oriented ones, however without being an OO language.
>
> To be a truely OO language, the language has to support inheritance and
> dynamic binding (besides all the stuff that modules support of course).
>
> It's kind of silly to talk about OO features when there are no mention
> about those two things.
>
--
--------------------------------------------------------------------
Yann Ramin atr### [at] atrustrivalie eu org
Atrus Trivalie Productions www.redshift.com/~yramin
Monterey High IT www.montereyhigh.com
AIM oddatrus
Marina, CA
IRM Developer Network Toaster Developer
SNTS Developer KLevel Developer
( this .sig represents the view of the world at any one
moment. Enjoy! )
"If I read the DeCSS source code in a forest, would it make
a copyrightable sound?"
- mwalker
"All cats die. Socrates is dead. Therefore Socrates is a cat."
- The Logician
--------------------------------------------------------------------
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Yann Ramin <atr### [at] atrustrivalie eu org> wrote:
: Why not support a Perl based scene building language?
Isn't povray scripting language already something like that?
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp <war### [at] tag povray org> wrote in message news:39cf092b@news.povray.org...
> Isn't povray scripting language already something like that?
Well, not EVEN REMOTELY comparable to the power of Perl! Just an example: I
have seen an XML parser in Perl which was written in just 30 lines...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Alessandro Coppo <a.c### [at] iol it> wrote:
: Well, not EVEN REMOTELY comparable to the power of Perl! Just an example: I
: have seen an XML parser in Perl which was written in just 30 lines...
So the power of a language is measured by the number of lines it takes
to do something.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Margus Ramst wrote:
> POV already contains many features usually associated with
> modellers, but implementing renderer-specific features should always have higher
> priority.
Since I've been sort of an ornery troublemaker, here, let me affirm the wisdom of that
statement. Yes, when it comes to investing POV-Team manhours into, say a new GUI
modeller's interface, or new higher-tech radiosity features, then render-specific
features should have a higher priority.
Is is only when this "render-not-modeller" philosophy is applied to art criticism or
the
cool object-specific features of pov that I object. Trace functions, isosurfaces,
#write, object patterns, and the like have very little to do with rendering, and a
purist application of "r-not-m" would probably poo-poo at these features.
Perhaps, however, that's part of the reason we end up with patches.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Wed, 27 Sep 2000 09:43:10 +0200, Alessandro Coppo wrote:
>
>Warp <war### [at] tag povray org> wrote in message news:39cf092b@news.povray.org...
>> Isn't povray scripting language already something like that?
>
>Well, not EVEN REMOTELY comparable to the power of Perl! Just an example: I
>have seen an XML parser in Perl which was written in just 30 lines...
I've seen a POV program that makes a PNG of a reflective sphere on a checkered
plane in just one line. Let's see you do that with Perl.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Proudly not helping RIAA and SDMI steal my rights --
http://www.eff.org/Misc/EFF/Newsletters/EFFector/HTML/effect13.08.html
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Yann Ramin wrote:
> "All cats die. Socrates is dead. Therefore Socrates is a cat."
> - The Logician
>
> --------------------------------------------------------------------
Nonsense. WAS a cat.
--
I have never had any plans to get out of this world alive.
-- The Iron Webmaster, 61
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Yann Ramin wrote:
>
> Why not support a Perl based scene building language? Maybe a filter which
> spits out POV from Perl code... :)
Why not write the bindings to Perl? I don't know if the source supports
that but it wouldn't hurt to take a look. While Perl is on my "to learn"
list, it is not on most people's list.
--
Matt Giwer, EE, courtesy of the US Civil Service
Commission.
-- The Iron Webmaster, 76
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
>
> Yann Ramin <atr### [at] atrustrivalie eu org> wrote:
> : Why not support a Perl based scene building language?
>
> Isn't povray scripting language already something like that?
I have always thought it is like an elephant viewed by seven blind men.
--
http://www.google.com can't find anything similar to
http://www.giwersworld.org
good luck to them.
-- The Iron Webmatster, 109
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Alessandro Coppo wrote:
>
> Warp <war### [at] tag povray org> wrote in message news:39cf092b@news.povray.org...
> > Isn't povray scripting language already something like that?
> Well, not EVEN REMOTELY comparable to the power of Perl! Just an example: I
> have seen an XML parser in Perl which was written in just 30 lines...
Perl has had how many people working on it for how many years in how
many applications?
Without sarcasm intended just what benefit would it be given the very
straightforward nature of it in the first place?
If really looking for Perl one of the big guys, Sun I think, I posted
it in off-topic, released their proprietary 3D language about a month
ago. I found a reference to a group forming to create Perl bindings for
it.
--
Gun control: The principle that criminals will not have guns
if having guns is a crime.
-- The Iron Webmaster, 107
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp <war### [at] tag povray org> wrote in message news:39d1d49a@news.povray.org...
> So the power of a language is measured by the number of lines it takes
> to do something.
Well, if lines of codes do not count, then do switch to assembler. You will
have the pleasure of writing from 10 to 20 lines for each C/C++ line....
I thought it would be obvious, but apparently it is not, so I spell out the
whole story.
POVRay language defines objects and their property, plus how they are build
to together. No discussion about the objects and property side, but the
build together side could be vastly improved by another language. Think of
what could you do if instead of just #macro's you have a complete OO
language capable of creating scenes (i.e. assembling POV primitives). It is
exactly the same as saying that #macro's (who needs more programming power?)
are useless instead of being the gigantic improvement of POV 3.1.
You want an example? Consider what could you do if, instead of having fixed
values inside a color_map, you could create a color_map from arbitrary
code... each value the result of a function call... and this is just an
example.
Still, if the POVTeam does not want to do something, they just have to say
'NO' and nobody will complain.
P.S.:
do you prefer a 30 lines XML perl parser or a 500KB C++ xml parser
(Xerces?). Which one is simpler to understand?
P.P.S:
I want to start a flame war. Add to POVRay 4 the capability of using XML
files as language input.
Bye...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
So what makes a language powerful is not the number of lines but how
easy and intuitive is to make something.
If I want a more "powerful" language, what stops me from using whatever
language I want to generate the povray output?
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Warp" <war### [at] tag povray org> wrote in message
news:39d47a94@news.povray.org...
> So what makes a language powerful is not the number of lines but how
> easy and intuitive is to make something.
>
> If I want a more "powerful" language, what stops me from using whatever
> language I want to generate the povray output?
>
Interesting idea - has anyone ever written an alternative scene language for
POV (e.g. OOP) that, when run, outputs a translation to normal pov scene
lang.?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Tom Melly <tom### [at] tomandlu co uk> wrote:
: Interesting idea - has anyone ever written an alternative scene language for
: POV (e.g. OOP) that, when run, outputs a translation to normal pov scene
: lang.?
I think that someone has made a C++ library (using full object-orientedness)
for reading and creating povray objects and files.
IIRC it could even read povray 3.0 files.
Try searching the povray links section (if no-one gives an URL here before
that).
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Alessandro Coppo wrote:
> No discussion about the objects and property side, but the
> build together side could be vastly improved by another language. Think of
> what could you do if instead of just #macro's you have a complete OO
> language capable of creating scenes (i.e. assembling POV primitives).
There are some pov users that are programming idiots. I got A's in high school
BASIC and college FORTRAN classes (I'm 35) but am utterly OO-illiterate,
despite having spent a few hundred on Java and C books.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Tom Melly <tom### [at] tomandlu co uk> wrote:
> "Warp" <war### [at] tag povray org> wrote in message
> news:39d47a94@news.povray.org...
>> So what makes a language powerful is not the number of lines but how
>> easy and intuitive is to make something.
>>
>> If I want a more "powerful" language, what stops me from using whatever
>> language I want to generate the povray output?
>>
> Interesting idea - has anyone ever written an alternative scene language for
> POV (e.g. OOP) that, when run, outputs a translation to normal pov scene
> lang.?
Somewhat. I have a particle system in c++, that when compiled outputs the
system in POV readable format. IT's all OO. But I've found that that's
only useful when it's really time intensive. If there was an existing code
base (ie, all the primitives and such already spelt out), but as it is, it's
not useful in general.
Geoff
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
>
> Greg M. Johnson <gre### [at] my-dejanews com> wrote:
> : Say you're doing a 400 x 300. That's 1200 pixels.
> : First you shoot pixels AS IF it were a 40 x 30, where you choose by some
> : algorithm 1 pixel out of every block of 100.
> : Report the color of these pixels to the viewer as if it were ONLY a 40 x 30.
> : Now assume it's a 160 x 120, shoot 3 pixels out of every block of ....... and
> : so on......
>
> How do you calculate antialiasing here?
Since the 'preview' image is not a final product, skip anti-aliasing and
save lots of computation.
++Eric
--
Eric Fielding
Eri### [at] sierras jpl nasa gov -or- Eri### [at] jpl nasa gov
MS 300-233 direct phone: +1 (818) 354-9305
Jet Propulsion Lab fax: +1 (818) 354-9476
4800 Oak Grove Drive
Pasadena, CA 91109
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Greg M. Johnson <gre### [at] my-dejanews com> wrote:
: but am utterly OO-illiterate,
: despite having spent a few hundred on Java and C books.
Knowing an OO-language doesn't mean you know how to make OO-programs.
It's a very common mistake to think otherwise.
An object-oriented programming language can't force you to make
object-oriented programs. The reason is that the object-oriented design of
a program starts before you write even the first line of code.
To learn object-oriented programming you have to read books about
object-oriented programming, not books about some programming language.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> To learn object-oriented programming you have to read books about
> object-oriented programming, not books about some programming language.
So if POV-Ray incorporates OO style syntax I am going to have to go
out and buy books to learn how to use it ? This does not sound very
encouraging !
--
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken <tyl### [at] pacbell net> wrote:
: So if POV-Ray incorporates OO style syntax I am going to have to go
: out and buy books to learn how to use it ? This does not sound very
: encouraging !
No, it means that you'll be using the OO style syntax but you probably will
not be making very good OO-programming.
Although the OO programming language can't force you to make good OO
programs, it doesn't mean you can't make any programs with it. If you don't
know OO design they will just be poor OO programs.
So don't worry; if povray ever incorporates OO style syntax I don't think
you or anyone else will have too many problems using it.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> An object-oriented programming language can't force you to make
> object-oriented programs. The reason is that the object-oriented design of
> a program starts before you write even the first line of code.
>
Actually, I think my blobmon character is object-oriented, in the way I've
broken down INC's to handle different tasks. One has just raw data, another
computes how raw data variables crunch each other, another poses the model. A
POV file would then include the INC and have a walking figure...
Am I correct in that you could "object-orient" a very complicated scene file
with today's povray?
I've sat through the first-grader's presentation on OO at the beginning of
those C and Java tutorials I've seen at work and on the web........
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Fri, 29 Sep 2000 12:30:34 +0100, Tom Melly wrote:
>"Warp" <war### [at] tag povray org> wrote in message
>news:39d47a94@news.povray.org...
>> So what makes a language powerful is not the number of lines but
>> how easy and intuitive is to make something.
>>
>> If I want a more "powerful" language, what stops me from using
>> whatever language I want to generate the povray output?
>
>
>Interesting idea - has anyone ever written an alternative scene
>language for POV (e.g. OOP) that, when run, outputs a translation to
>normal pov scene lang.?
Not a real scene language, but a few of my earliest scenes are actually
a combination of hand-coded povscript and perl-generated pov-script. So
you could say I used perl as a scene-description language :-)
Don't remember why I did it this way. PovRay 3.0 already had #while and
#if. Maybe it wasn't in the docs.
hp
--
_ | Peter J. Holzer | flexibilität kommt von dem paket
|_|_) | Sysadmin WSR | vor dem rechner.
| | | hjp### [at] wsr ac at | -- August Hörandl in
__/ | http://www.hjp.at/ | at.linux, 2000-09-24
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Greg M. Johnson <gre### [at] my-dejanews com> wrote:
: Actually, I think my blobmon character is object-oriented, in the way I've
: broken down INC's to handle different tasks. One has just raw data, another
: computes how raw data variables crunch each other, another poses the model. A
: POV file would then include the INC and have a walking figure...
That's modular programming. You split the bigger task into smaller more or
less independent tasks.
Yes, modularity is an essential part of OO programming, but whether simple
modularity can be considered OO in itself or not is not clear.
As far as I have understood it, the splitting of a bigger task into smaller
ones (by dividing it into functions, macros, include files or whatever) is
not yet object-oriented programming.
In OO-programming objects have a declaration (usually called 'class'). This
declaration (class) describes how the object looks like and how it can be
used (ie. it declares an interface). An essential part of this interface
is the so-called information hiding, that is, the implementation of the
class (ie. its data structures and implementation code) is not seen from
the outside and can't be accessed.
These classes are also called "abstract data types" because they usually
behave exactly like any other data type. For example it could be possible
to make an integer class which behaves exactly like any regular integer
type but may have internally more functionality.
An instance of this class is called object. An instance is when you create
a physical object which you can handle (part of this creation is allocating
memory for it (often made automatically by the compiler), initializing it
(usually made by the class itself) and so on). There can be many instances
(ie objects) of the same class and they are (usually) independent and
unaware of each other. Each object can have a different state (ie. its internal
values can be anything independently of the other objects of the same class).
An essential part of OO-design is that often objects have common features
and behaviours.
For example suppose that you have a class named 'dog' and another named
'cat' and a third called 'tree'.
The 'dog' and the 'cat' classes will probably have many common functionality
(a functionality which is common to all animals) but different from the
'tree' class. All of them may also have some features common to all living
things (like being alive or dead, etc).
If a 'dog' can walk and eat, and a 'cat' can also walk and eat, it would
be a bit silly to code the exact same functionality to both (and doing so
would break many modularity principles).
Sometimes you may also want to handle dogs and cats (and other
animals) in a common way. For example you may have a 'house'-container
with several instances of 'dog' and 'cat' (and perhaps many other
animals) and want to handle all of them in the same way. It would also be
a bit silly to code something like:
if(object is a dog) then make the dog walk, else
if(object is a cat) then make the cat walk, else
...
It would just be a lot easier (and modular) to say just:
make the animal walk
This is where inheritance kicks in. Since dogs and cats have common features
(which are common to all animals) and both of them have common features with
the 'tree' (features common to all living things), more abstract classes
could be created.
We can create an 'animal' class which contains everything that is common
to all animals. Then the 'dog' and 'cat' classes can inherit those features
to itself and then specify some features exclusive to dogs or cats.
Also we can create a 'plant' class and inherit 'tree' from it.
Since animals and plants have some common behaviours we can create even a
more abstract class (like 'living_thing' or whatever) and inherit both from
it.
The inheritance relation between two classes is usually called
"is-a relation", that is, "dog is an animal" and "animal is a living_thing".
Everything that holds for an 'animal' also holds for a 'dog', ie an object
of type 'dog' can be used everywhere an object of type 'animal' is expected.
It is also possible that some behaviour is common to all animals (eg.
"make noise") but the implementation is specific to each type of animal
(ie. the type of the noise). It is possible to say in the 'animal' class
that all animals make noise but the implementation (which is specific to
each animal) is made in the inherited classes.
This has several advantages:
- It structures your data types in a logical way.
- It's extremely modular. Behaviours that are common to a series of classes
can be written only once instead of having to write it to several places.
- The abstraction level scheme (thanks to inheritance) gives a lot of
flexibility. It is possible to make, for example, a function that takes
an object of type 'animal' and makes something to it. It doesn't care what
type of animal it is. Then you can give cats and dogs to it and it will work
equally for both. You can also later create new classes inherited from 'animal'
and give them to the function and it will still work without the need of any
modification.
For example this function could make two things to the 'animal' object:
"walk here" and "make noise". The "walk here" could be independent from
animal to animal and the implementation in the 'animal' class is automatically
called (unless specifically overridden in the inherited class). The "make
noise", however, depends on the type of animal. Still the function doesn't
need to know the type of animal; it just calls the "make noise" functionality
in the 'animal' class and that's it. It doesn't care which implementation is
actually called.
This feature allows extreme modularity: You can create new types of animals
with their specific way of "making noise" and this function will still work.
You don't have to modify the function to take into account this new animal
type.
It's important to note the type of the inheritance relation. The relation
is always an is-a relation, ie. from a more abstract concept to a more
concrete concept. It's too usual to misuse this relation.
The most usual mistake is to use it as if it was a "has-a" relation.
For example, since a 'car' "has a" 'wheel', then we inherit a car from a
wheel.
This is wrong, of course. A 'car' is NOT a 'wheel'. You can't use a 'car'
where a 'wheel' is expected. A 'wheel' is a part of the 'car', ie. the
car consists of 'wheel' objects (among others).
The inheritance relation should always be from a more abstract concept
to a more concrete concet. For example it's perfectly normal to think that
a 'car' is a 'vehicle'. An object of type 'car' can be used anywhere an
object of type 'vehicle' is expected.
This is why in povray splitting a bigger object into smaller objects (which
can possibly be copied more than once to create the bigger object) can't be
called OO-programming. It's modular, but it's not purely object-oriented.
You can't create abstract concepts in povray and then inherit concrete
concepts from them. You can't for example, create a 'furniture' class
(which is probably so abstract that you can't create an instance, ie an
object from it) and then inherit things like 'table' and 'chair' from it.
You can't create, for example, an array containing 'furniture'-type objects
and add 'tables' and 'chairs' to it (as it is possible in OO-languages).
Objects in povray don't have clear interfaces either.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
You sure are talkative today :)
--
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Also I am going to talkative....
First of all, the renderer-not-modeller question.
Well, if you stick to a pure renderer vision, as long as you can handle a
tridimensional triangulated surface, with uv mapping info for each vertex,
external texture/bump/relief etc. maps, plus lights and a camera, you can do
anything. By the way, this is 80% of what almost every 3D tool in world does
(yes, they give you EXTREMELY powerful ways of manipulating the mesh and
NURBS etc., but still the basis is this).
Don't you believe this? Well, a box is made up by six faces, each
triangulated by 2 triangles, all together connecting 8 vertices (is the
right plural of vertex? I hope so). Open an OBJ mesh and you will see...
Why don't we develop with POVray in the same way? Because we have more
abstract (yes, Warp, also more compact....) ways of doing the same. An
isosurface is simpler than a 100K vertex mesh, isn't it?
The conclusion of this part is that, as long as the POV team gives us new
(more abstract, more compact to use, higher level) primitives, we are all
happy.
Then, there is another subject, TOTALLY ORTHOGONAL to the above one.
It is the subject of how we compose these primites. By hand, before 3.1,
with macros now. What I am saying is that if the POV team gives us a more
powerful language to build complex scenes, the better. What I am saying is
that ANY feature increasing the power of the macro language makes complex
scenes easier to write. What I propose, provided 4.0 license becomes
compatible with GPL or something of this kind is NOT to reinvent the wheel
(square...) but to adopt an open source language whose objective is to
control the creation of objects (sorry for the tongue twister). You are an
OOP purist (right, I HATE procedural languages) so I make this proposal:
pair old macro language with, e.g. Python. One can say that there are lots
of predefined classes with correspond to POVRay objects, elements
(color_map, finish, etc.) and that "creating" these objects adds them to the
scene. At last, you assign lights and a camera to the scene and tell it to
render itself (with appropriate options). See that there is an object model?
I cannot write UML in ASCII, so understand autonomously if it is containment
or inheritance...
Scene
Camera
Lights
Light
Point
Area
...
Objects
texture
color
normal
finish
Primitives
Box
Plane
...
Complex
isosurface
...
BaseMesh
mesh
mesh2
nurbs
etc.
E.g. I would like to write a subclass of BaseMesh which could directly parse
an .OBJ file without conversion!
By the way, I am sure that the OO reengineering of POV will create these
classes. You have then this situation: "native" classes, implemented in C++
and "user extension" classes, derived from the framework, written in Python
or whatever it is selected. A compatiblity layer allows the usage of 3.5
language.
See? I don't think it is a bad structure.
Bye bye!!!!
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Alessandro Coppo wrote:
> What I am saying is that if the POV team gives us a more
> powerful language to build complex scenes, the better.
> ... You are an
> OOP purist (right, I HATE procedural languages) so I make this proposal:
> pair old macro language with, e.g. Python.
Here is the caveman's answer to your proposal: keep the language simple. There
are non-programmer enthusiasts out here in the pov community. I'm a
metallurgical engineer who has a lot of programming sense (aced BASIC in high
school and FORTRAN in college) but every time I pick up a Java book, and some C
books, I drop it, gagging. BASIC has a nice intuitive sense for us
non-programmers, and the current povray language is equally cool.
Here I a joke I told a year ago. If the father of Java had invented povray, we
would have to code our scenes like this:
//---------------------------------------------------------------------------------------------------------------------------
import java.colors.*
import java.geometry.shapes.*
import java.light_sources.*
import java.rays.traceable.*
public void status main init destroy sPhere {
java.Geometry.Objects.shapes.roundyOnes.convexOnes.sPhere()
new radius= Radius;
new finish= Finish;
Radius= 1;
public void status main init destroy fInish{
java.texture.finish.prettyOnes.Reflective()
this.Finish=that.fInish;
die;
}
public void status main init destroy lOcation{
java.space.Cartesian.coordinates.linear.Nearby()
this.Location.x=0;
this.Location.y=0;
this.Location.z=0;
die;
}
}
public void status main init destroy pLane{
java.Geometry.Objects.shapes.infiniteOnes.flatOnes.Plane()
this.Direction=up;
public void status main init destroy pIgment{
java.texture.pigment.complexOnes.cHecker()
this.Pigment=try {
this.color=pigment.Green;
catch e exception error void yourself on main street();
that.color=pigment Red;
die;
}
}
public void status main init destroy you all {
java.Devices.nonObjects.pIcturetaking.cAmera()
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
The povray language could be kept simple because no-one is going to make
very big programming projects with it. The povray scripting language is
mainly for making scenes, not for making programs.
If the goal is to make a big programming project, then a simple BASIC-style
programming language will not be enough.
No, you can't make BIG programs with procedural BASIC-style programming
languages.
"Making a program" doesn't only mean that you write 100000 lines of code
that seem to work. It also means that you can modify the code easily, add
easily new features to it, make overall bugfixes (like y2k fixes) fastly and
easily, reuse many parts of the code in several places of the program and
also in other programs and so on.
Knowing how to write something with a programming language doesn't
mean that you know how to program. It's very similar to the fact that
knowing how to write english doesn't mean that you know how to write a good
book.
Fortunately povray doesn't need this kind of programming (yet).
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> Knowing how to write something with a programming language doesn't
> mean that you know how to program.
I think I know how to program, in that I can solve complex issues (a rising heel
in a walk cycle of a blob character, and do so in a way that easily translates
itself to walking up stairs with only changing two variables) but have
difficulty learning the newer programming languages.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Greg M. Johnson <gre### [at] my-dejanews com> wrote:
: I think I know how to program, in that I can solve complex issues (a rising heel
: in a walk cycle of a blob character, and do so in a way that easily translates
: itself to walking up stairs with only changing two variables) but have
: difficulty learning the newer programming languages.
Programming is not only knowing how to solve a problem.
Programming is also knowing how to make the program efficient (by using
proper algorithms and data structures), modular, reusable and so on.
Those things cannot be learnt by knowing a programming language.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I think I know how to make the program efficient (by using proper algorithms and data
structures), modular, reusable and so on.
I just chafe at the inelegance of some languages like Java.
Warp wrote:
> Those things cannot be learnt by knowing a programming language.
They aren't learned in computer science; it's just plain logic and common sense.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Greg M. Johnson <gre### [at] my-dejanews com> wrote:
: They aren't learned in computer science; it's just plain logic and common sense.
I wouldn't say that. Computer science gives you the basic theory. Of course
experience is needed, but experience without knowledge is of little use.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <39d47d5b$1@news.povray.org>, "Tom Melly"
<tom### [at] tomandlu co uk> wrote:
> Interesting idea - has anyone ever written an alternative scene
> language for POV (e.g. OOP) that, when run, outputs a translation to
> normal pov scene lang.?
I have been playing around with this idea..."CSDL", or C-like Scene
Description Language. It would be an object-oriented language with a
vaguely C-like syntax(variable declaration style, {} blocks, flow
control statements, etc).
I would have a translator program that reads the CSDL files and outputs
.pov files(the first version would execute the CSDL and output objects,
but later versions might be able to translate some things like loops to
POV code). Other features could be things like OpenGL previews.
Unfortunately, I haven't found any good quick-start tutorials for Bison
or Flex and nothing on using the versions of these tools available on
the Mac(which seem to be very few, undocumented, and not up-to-date.).
This shouldn't be a problem with OS X though...yet another advantage of
a UNIX-based system. :-)
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
You guys look at this the wrong way... What about the people not wanting to
spend hours learning a new language, instead of just adding to whatever they
know about POV-Ray language already?
Besides, C++ based languages have a tendency to have a _very_ steep
learning curve...
This was just a thought, felt like sharing it... :P
Zilvah
------------------------------------------------------------------------
"Chris Huff" <chr### [at] mac com> wrote in message
news:chrishuff-B19E31.11023906102000@news.povray.org...
> In article <39d47d5b$1@news.povray.org>, "Tom Melly"
> <tom### [at] tomandlu co uk> wrote:
>
> > Interesting idea - has anyone ever written an alternative scene
> > language for POV (e.g. OOP) that, when run, outputs a translation to
> > normal pov scene lang.?
>
> I have been playing around with this idea..."CSDL", or C-like Scene
> Description Language. It would be an object-oriented language with a
> vaguely C-like syntax(variable declaration style, {} blocks, flow
> control statements, etc).
> I would have a translator program that reads the CSDL files and outputs
> .pov files(the first version would execute the CSDL and output objects,
> but later versions might be able to translate some things like loops to
> POV code). Other features could be things like OpenGL previews.
>
> Unfortunately, I haven't found any good quick-start tutorials for Bison
> or Flex and nothing on using the versions of these tools available on
> the Mac(which seem to be very few, undocumented, and not up-to-date.).
> This shouldn't be a problem with OS X though...yet another advantage of
> a UNIX-based system. :-)
>
> --
> Christopher James Huff
> Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
> TAG: chr### [at] tag povray org, http://tag.povray.org/
>
> <><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3a1168e8@news.povray.org>, "Zilvah" <zil### [at] online no>
wrote:
> You guys look at this the wrong way... What about the people not
> wanting to spend hours learning a new language, instead of just
> adding to whatever they know about POV-Ray language already?
The current language has a lot of "extra baggage", and some parts aren't
well designed, there are some odd little inconsistencies...redoing the
language to something close to but better than the current language
would be a good idea.
It should be similar enough to the existing POV-Script that there
wouldn't be a lot of new stuff to learn, and could actually be easier to
learn than the current POV-Script.
> Besides, C++ based languages have a tendency to have a _very_ steep
> learning curve...
I wasn't talking about a C++ based language, C++ would be way too
complex, with a lot of stuff useless to POV users.
I'm talking about a new one with some C-like characteristics(like using
{} for all blocks, "variableName = value;", the same loops and
conditional statements), and some object-oriented features, like member
variables/methods and simple inheritance.
Actually, I am now thinking of developing "CSDL" into a language for
describing any scenes, not just for POV. It could be used as a modeller
scripting language or to test out algorithms, do simulations, etc...it
is just a personal experiment, but I think the POV language could take a
similar direction.
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Chris Huff <chr### [at] mac com> wrote:
: and some object-oriented features, like member
: variables/methods and simple inheritance.
If object-orientedness is ever implemented in the povray scripting language,
my opinion is that it should be done well from the beginning.
In my opinion a language that has some OO features but is only "half-OO"
is a bad idea.
It should have all the basic OO features:
- Full modularity support (which means at least public and private parts).
- Member functions and variables (if we are purists, member variables in
the public interface should be made illegal).
- Full inheritance support, which means:
- A protected part in the class (besides public and private).
- Dynamic binding (that is, virtual member functions).
- Abstract (ie. pure virtual) member functions and abstract classes
(aka. interface classes).
- A way to create instances of classes (ie. objects) and thus references
(that is, pointers).
- Class functions and class variables (usually called 'static' in many
languages).
NOTE: The fact that the language supports all those things does NOT mean
that you have to learn all those things to just make simple scenes.
NOTE 2: Read the previous note again.
NOTE 3: Please read it again.
NOTE 4: Did you read it?
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
>Chris Huff <chr### [at] mac com> wrote:
>: and some object-oriented features, like member
>: variables/methods and simple inheritance.
>
> If object-orientedness is ever implemented in the povray scripting
> language, my opinion is that it should be done well from the beginning.
> In my opinion a language that has some OO features but is only
> "half-OO" is a bad idea.
>
In the several discussions there where on this OO-pov topic, there is one
thing I don't understand, or maybe it's my ignorance; Why design a new
language? Why not pick a suitable, already existing OO-language with
everything on it and write the appropriate modules, classes etc.?
Python & POV:
http://www.inetarena.com/~pdx4d/ocn/cp4e.html#python
3D Python:
http://virtualphoton.pc.cc.cmu.edu/projects/visual/
(Chris, a mac (alpha)version is now available)
Ingo
--
Photography: http://members.home.nl/ingoogni/
Pov-Ray : http://members.home.nl/seed7/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <8FE### [at] povray org>, ing### [at] home nl (ingo) wrote:
> In the several discussions there where on this OO-pov topic, there is one
> thing I don't understand, or maybe it's my ignorance; Why design a new
> language? Why not pick a suitable, already existing OO-language with
> everything on it and write the appropriate modules, classes etc.?
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...).
Things like vectors, colors, textures, and shapes as part of the
language instead of classes in a library for the language, etc.
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. :-)
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...
> Python & POV:
> http://www.inetarena.com/~pdx4d/ocn/cp4e.html#python
> 3D Python:
> http://virtualphoton.pc.cc.cmu.edu/projects/visual/
> (Chris, a mac (alpha)version is now available)
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
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. Oh, and I didn't cut off the end...but the lack of some kind
of end to the while loop makes me nervous.
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
heh, starting at the basics, why not add to the language, and maybe adding
support for another?
I miss halo's.... :P
anywayz, as long as no one even mentions Visual Basic, I'm fine :-)
Lord Z.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3a141c44$1@news.povray.org>, "Zilvah" <zil### [at] online no>
wrote:
> heh, starting at the basics, why not add to the language, and maybe adding
> support for another?
I'm not sure what you are proposing...adding another scene language
while retaining the current one instead of building on and modifying
what we have now?
> I miss halo's.... :P
Halos were mostly a renderer feature.
> anywayz, as long as no one even mentions Visual Basic, I'm fine :-)
Eww...
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <8FE### [at] povray org>, ing### [at] home nl (ingo) wrote:
> 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?
Why try to force one of those languages to do something it isn't
designed for? Design a new one!
And I am not saying a library for one of those languages is a bad idea,
just that it would be a really poor replacement for a scene description
language.
> Doesn't a library or module become part of the language? Big parts of
> Python are written in Python.
No. Libraries are separate from languages. The stuff in VPython doesn't
even *look* like part of the language, it is obviously calling stuff
from Python to create things.(BTW, the Mac version was based on an old
version of Python, so I can't get it to work)
> Mmm, what is "the language", everything in the distribution, or only the
> part that needs no modules to be imported?
The "language" is the collection of basic keywords, control statements,
and syntax. In POV, #declare, #while, #macro, sphere, color, vectors,
etc. are all part of the language. "White", "Green" "T_Glass3", etc. are
*not* part of the language, they are parts of a standard library. In
C++, while, if, switch, short, float, declation syntax, etc. are all
language features. However, vector templates, cin, cout, assert, etc.
are all library features.
> > 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).
I meant that if it doesn't work for some system, you don't have to hack
into someone else's source code to get it to work. It makes POV less
dependant on external factors.
> No need to write scene files, it could interact directly with the render
> engine.
In other words, replace the scene language with Python(or some other
language that you are forcing into this niche).
Also, try doing that in a cross-platform way...
> 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))
Not much better at all. In fact, it's worse...
> Just like most POV users won't be happy with any OO-POV. It's different.
Wrong. It could be done to be very much like the way things work now,
just with additional features.
> >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.
You like the fact that you have to think about where things end instead
of just looking for the "}", ";" or some "end" statement?
> And if you're used to indent, you won't have a problem with white
> space being meaningfull.
There would be a lot of people unhappy that their personal styles won't
work. *I* would be unhappy. Having "nothing" mean something sounds like
a really bad idea...
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 7 Sep 2000 16:15:18 -0400, Ron Parker wrote:
>On Thu, 7 Sep 2000 22:17:53 +0200, Alessandro Coppo wrote:
>>
>>Well, with this kind of containers it would be possible to fake object
>>oriented programming. For example
>
>[...]
>
>>Having associative heterogeneous arrays + macros is all that is needed for
>>OOP in POVRay.
>
>Careful there, you'll get Warp all revved up again. What you're talking
>about is structured programming, not OOP.
>
>--
>Ron Parker http://www2.fwi.com/~parkerr/traces.html
>My opinions. Mine. Not anyone else's.
>
--
Cheers
Steve email mailto:ste### [at] zeropps uklinux net
%HAV-A-NICEDAY Error not enough coffee 0 pps.
web http://www.zeropps.uklinux.net/
or http://start.at/zero-pps
1:14am up 125 days, 2:03, 2 users, load average: 1.68, 1.27, 1.15
Cheers
Steve email mailto:ste### [at] zeropps uklinux net
%HAV-A-NICEDAY Error not enough coffee 0 pps.
web http://www.zeropps.uklinux.net/
or http://start.at/zero-pps
1:14am up 125 days, 2:03, 2 users, load average: 1.68, 1.27, 1.15
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Steve wrote:
> On 7 Sep 2000 16:15:18 -0400, Ron Parker wrote:
>
>> On Thu, 7 Sep 2000 22:17:53 +0200, Alessandro Coppo wrote:
>>
>>> Well, with this kind of containers it would be possible to fake object
>>> oriented programming. For example
>>
>> [...]
>>
>>
>>> Having associative heterogeneous arrays + macros is all that is needed for
>>> OOP in POVRay.
>>
>> Careful there, you'll get Warp all revved up again. What you're talking
>> about is structured programming, not OOP.
>>
>> --
>> Ron Parker http://www2.fwi.com/~parkerr/traces.html
>> My opinions. Mine. Not anyone else's.
>>
I have decided to keep quiet, write code... and... well, I will have
something to show you by Christmas 2001, something which will make all
this discussion useless.
Bye!!!
Alessandro Coppo
a.c### [at] iol it
P.S.: Hints: it is not a POVClone, it is not written in C++.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |