 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"object" seems a little hard to grasp for beginners in POV-Ray but it may get
worse in POV 4 when more object oriented syntaxes are probably going to make
their way into the language. What would intuition expect an "object" keyword to
do ? I will not speculate... but what it actually does in POV-Ray certainly is a
much more specific feature, called instanciation and documentation explains it
correctly. I think "instance" would be less surprising and less loaded with
extra meaning,
for instance, the kind of mistakes the current phrasing leads newcomers to is to
try and use it like a CSG keyword, trying to feed it whatever sort of input
between the braces, expecting it would result in an object... while the input it
expects should in fact already be an object and a single one! also it does allow
to populate it with either a declared variable name invoking an object, but also
a root level primitive (sphere cylinder etc)! ... This I don't know why... as it
encourages one level nesting that seems useless. Thanks for sharing your
opinions on this and I already know I'll learn from them!
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Mr" <m******r******at_hotmail_dot_fr> wrote:
> I think "instance" would be less surprising and less loaded with
> extra meaning,
I think instantiate would be better - more verb/sentence-like.
#declare Thing = sphere { ... }
#instantiate {Thing}
There has definitely been much past discussion about the syntax of SDL.
Being able to define keyword aliases would help explore this a lot.
#declare Thing = sphere { ... }
#object {Thing}
#alias object = instantiate;
#instantiate {Thing}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
hi,
"Mr" <m******r******at_hotmail_dot_fr> wrote:
> "object" seems a little hard to grasp for beginners in POV-Ray ...
> Thanks for sharing your opinions on this ...
I guess (I can imagine) "lacking historical perspective" being a problem; ie
person not taking into account that POV-Ray and the SDL vocabulary were around
before object-oriented everything became "the paradigm".
regards, jr.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Mr" <m******r******at_hotmail_dot_fr> wrote:
> "object" seems a little hard to grasp for beginners in POV-Ray but it may get
> worse in POV 4 when more object oriented syntaxes are probably going to make
> their way into the language.
Early concept of 'objects' can be traced to AI work at MIT in the late
1950s–early 1960s, where 'objects' referred to atoms with identified properties
(attributes).
So object predates oop. The non-oop object = struct = record.
In my own raytracer I use shape, at first because it collides with Object as
uses in Nim (as Record). Then shape isn't right either. A triangle is a shape,
but a bag of triangles is not a shape. So I will eventually use primitive, where
the bag of triangles (mesh) becomes `patch' as in stitched together (quilting)
instead of repair.
In POV-Ray SDL object is fine, as that is what we deal with, virtual 3D objects.
Object is the top level container and there is no OOP relation. An then, there
are more or less friendly way to point a new user to the fine manual &
documentation.
(I hope we won't get (more) OOP in SDL in POV4)
ingo
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"ingo" <nomail@nomail> wrote:
> "Mr" <m******r******at_hotmail_dot_fr> wrote:
> > "object" seems a little hard to grasp for beginners in POV-Ray but it may get
> > worse in POV 4 when more object oriented syntaxes are probably going to make
> > their way into the language.
>
> Early concept of 'objects' can be traced to AI work at MIT in the late
>
> (attributes).
>
> So object predates oop. The non-oop object = struct = record.
>
> In my own raytracer I use shape, at first because it collides with Object as
> uses in Nim (as Record). Then shape isn't right either. A triangle is a shape,
> but a bag of triangles is not a shape. So I will eventually use primitive, where
> the bag of triangles (mesh) becomes `patch' as in stitched together (quilting)
> instead of repair.
>
> In POV-Ray SDL object is fine, as that is what we deal with, virtual 3D objects.
> Object is the top level container and there is no OOP relation. An then, there
> are more or less friendly way to point a new user to the fine manual &
> documentation.
>
> (I hope we won't get (more) OOP in SDL in POV4)
>
> ingo
okay... I still lack too much computer science background/experience to really
understand why more oop is bad for POV, but many seasoned povers agreeing with
you would suffice to convince me...
Still I feel that I could understand better the answer to this other question :
without any prior or later declaration in a scene, is there actually any use for
writing:
object{sphere<0,0,0>1}
instead of
sphere<0,0,0>1
....or is it just unintended side effects / syntax complexification that just got
allowed by accident?
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: ingo
Subject: Re: change "object" keyword to something more explicit like "instance"
Date: 16 Aug 2026 02:27:06
Message: <6a81583a$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
On 2026-08-16 01:04, Mr wrote:
> "ingo" <nomail@nomail> wrote:
> writing:
> object{sphere<0,0,0>1}
> instead of
> sphere<0,0,0>1
> ....or is it just unintended side effects / syntax complexification that just got
> allowed by accident?
I.i.r.c. the object wrapper was not always there, it came later in the game.
---%<-----%<----%<---object{sphere{<0,0,0>,1}}
#declare S = object{sphere{<0,0,0>,1}}
S
object{S}
sphere{<0,0,0>,1}
#declare A = sphere{<0,0,0>,1}
A
object{A}
---%<-----%<----%<---
These all render fine. I see them as implicit and explicit forms of the
same. I limit myself to use the explicit object, form when I want the
object to be rendered.
---%<-----%<----%<---
#declare A = sphere{<0,0,0>,1}
object{A}
or
object{sphere{<0,0,0>,1}}
---%<-----%<----%<---
I would not be amazed if POV-Ray in the end wraps everything in object
or equivalent before tracing.
ingo
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Mr" <m******r******at_hotmail_dot_fr> wrote:
is there actually any use for
> writing:
> object{sphere<0,0,0>1}
> instead of
> sphere<0,0,0>1
There may be a case where automated/script generated code would be easier to
write if object{sphere<0,0,0>1} is a valid construct.
- BE
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |