|
|
Christopher James Huff <chr### [at] maccom> wrote in message
news:chr### [at] netplexaussieorg...
> In article <3c57d5a1@news.povray.org>, "Tom Melly" <tom### [at] tomandlucouk>
> wrote:
>
> > IIRC 4.0 will be OOP - does this just refer to the source, the scripting, or
> > both?
>
> The POV Team has said they were rewriting it in C++. Actually, the
> current source implements a kind of OOP, it is just hard to manage.
> The scripting...it could be argued that it is already OOP: the various
> shapes are objects with a common interface (you apply textures,
> transformations, etc in the same way) and which can be arranged in a
> heirarchy, though they don't actually inherit from each other. The POV
> Team has mentioned they are considering reworking the language, but they
> haven't said anything more about it.
>
>
> > If the scripting is changing, anyone fancy giving an approximation of a sphere
> > on check plane using 4.00 scripting?
>
> I highly doubt any of this has been decided yet...POV 4.0 doesn't even
> exist yet, and it will probably go through many changes. Even the syntax
> of POV 3.5 is still changing.
> However, I'm guessing it would look something like it does now, at least
> recognizeable to someone who knows current POV script.
>
> --
> Christopher James Huff <chr### [at] maccom>
About 5 years ago, I happened across a rayshade script for
some Lego blocks.
I wasn't able to obtain a working copy of rayshade, so I decided
to write a ray-tracer that would read the rayshade file.
I dug out my college notes from my Compilers course and my
CG course, did the geometry calcs, and had a basic ray-tracer
that could do basic primitives, bicubic patches, csg,
transformations, and some limited surfacing (like pigments,
ambient, diffusion, and reflections). I even added some hooks
for animation.
The more I used it, the more I wanted to re-do it, making the
script object-oriented. I had two main motivations:
----------------------------------------
First, I wanted to be able to access an object's parts after the
object had been defined to be able to make one instance
different from another. A simplified example (using POV
pseudo-syntax):
#declare Part1 = cylinder { <0,0,0>, <0,1,0>, 1 pigment{Green}}
#declare Part2 = sphere { <0,0,0>, 1 pigment{White}}
#declare Piece = union {
object{Part1}
object{Part2 translate <0,1,0>}
}
#declare Piece1 = instance{Piece}
#declare Piece2 = instance{Piece}
#declare Piece2.Part1.pigment = Red;
So we get two pieces, but one is green and white, and the other
is red and white.
----------------------------------------
Second, I wanted to be able to access an object coordinate
space in order to connect to them. For example, if I wanted my
model of a person to move its arms about while holding a bar in
both of its hands, I could do something like this:
#declare end1 = John.LeftArm.ForeArm.Hand.coord(<0,1,0>);
#declare end2 = John.RightArm.ForeArm.Hand.coord(<0,1,0>);
cyclinder { end1, end2, 1 }.
----------------------------------------
I since found POVRay, and have used it instead of my own
simply because it is SO much better.
I still, however, have hoped to find a ray-tracer or graphics tool
that has the OO features that I planned for my own rewrite. I've
even considered writing a parser that would take an OO syntax
and generate standard POV code from it (once I have time for
something like that).
I know these things can be done in other ways using current POV
syntax, and I've done them. I just think it would be easier to do in
an OO syntax.
--
Tom Bates
Post a reply to this message
|
|