|
![](/i/fill.gif) |
Warp <war### [at] tag povray org> wrote...
> In povray this kind of labeling would just be a shortcut for first
> #declaring the thing and then creating an instance of it. It would just
> do both things at once.
> Then perhaps you could do something like (not necessarily with this
syntax):
>
> box \label{MyBox}
> { <1,2,3>, <4,5,6>
> transform \label{MyBoxTrans}
> { rotate x*30
> }
> }
>
> object { MyBox transform { MyBoxTrans inverse } }
>
There are problems with this approach (by which I mean using labeling to
#declare and create an instance). The problems are these:
1) memory consumption. If you #declare and then make an instance, you have
two copies of the object in memory. One copy is created in the symbol table
when you #declare it. The second copy is created when you make an instance
of the object. The first copy remains in the symbol table in case you want
to make another instance. If you did this with too many objects (or just a
few large objects) in a scene, it would be very bad.
2) ambiguity. Because there are two copies of object "MyBox", if you tried
to access an attribute of MyBox, which would it access -- the copy in the
symbol table or the copy in the scene. That one might be a bit too easy to
answer, so what if you were able to modify "MyBox", such as adding a new
transform or texture -- then which copy would be modified, and how would it
affect past and future instances?
These issues could be resolved, but it would not at all be easy to do so
with the current POV code. I ran into these same problems when dealing with
labels for persistent scenes for animations.
-Nathan
Post a reply to this message
|
![](/i/fill.gif) |