Re: On creating a new node from an existing node,

Johannes N. Johannsen (jojo@well.com)
Sat, 24 May 1997 10:08:45 +1200

Park SungWoo wrote:
>
> Hi,
>
> Consider the following example.
>
> DEF X ...
> DEF X1 USE X
> DEF X2 USE X
>
> What do you think of 'creating a new node from an existing node' ?

I think its a good idea. In your notation below, did you mean to leave
out USE?

> In the above example, nodes X1 and X2 share many common fields.
> We may want X1 and X2 to be independent nodes.
> Amulet employs this idea, right ??? (I'm not sure.)
>
> Probably, we may write as:
>
> DEF X ...
> DEF X1 X { A 1. 1. 1. # overrides A in X
> ...
> }
> DEF X2 X { B 0. 0. 0. # overrides B in X
> ...
> }

Also, what would this mean if instead of the first DEF, there was a
PROTO X?

One thing that confuses me about VRML 2.0 is that associating names with
objects is done in two ways (DEF & PROTO). The idea behind seems to be
these are fundamentally different somehow, but really they aren't since
both create instances eventually. But it turns out they create
instances in two different ways. It seems like there is a general
concept, not shown explicitly in the language, that would cover both
DEF, USE, & PROTO. I think that with a few minor changes PROTO could
entirely replace DEF/USE -- for example, if you could create an instance
as part of the PROTO declaration -- isn't that almost the same as DEF?

JJ