[x3d-public] Behavior of X3D's DOM integration
Behr, Johannes
johannes.behr at igd.fraunhofer.de
Thu Apr 16 06:03:00 PDT 2015
> <Group>
> <Shape DEF="A">
> <Sphere>
> <Appearance DEF="red">
> <Material diffuseColor='1.0 0.0 0.0'/>
> </Appearance>
> </Shape>
> <Shape DEF="B">
> <Box/>
> <Appearance USE="red"/>
> </Shape>
> </Group>
> On 16 Apr 2015, at 10:11, Kristian Sons <kristian.sons at dfki.de> wrote:
>
> Hi Johannes,
>>> >Using Johannes approach, one would circumvent this. On the other hand this would result in some magic transforming the DOM at other places if the user deletes or adds a node. I would find this very counterintuitive.
>> For me DEF/USE is really just a serialisation construct to map the graph to a tree and therefore two pointer to the same node which should behaviour exactly the same. According to the spec the node is the same. Deep-copies are done with Proto-instances. Therefore this should work:
>>
>> 1) Create to shapes (A,B) which share the material
>> 2) Delete one shape (A)
>> 3) (B) should still work with the given material in the setup state
>
> I absolutely see your point, this is how X3D works. However with your example above in the DOM starting from this:
>
> <Group>
> <Shape DEF="A">
> <Sphere>
> <Appearance DEF="red">
> <Material diffuseColor='1.0 0.0 0.0'/>
> </Appearance>
> </Shape>
> <Shape DEF="B">
> <Box/>
> <Appearance USE="red"/>
> </Shape>
> </Group>
If you interpret the DOM traversal as scene serialisation:
<Group>
<Shape DEF="B">
<Box/>
<Appearance DEF="red">
<Material diffuseColor='1.0 0.0 0.0'/>
</Appearance>
</Shape>
</Group>
This is exactly what aopt does if you delete A.
aopt -i in.x3d -d “A” -x out.x3d
best regards
johannes
>
> How would the DOM look like after deleting Shape#A?
>
> Best,
> Kristian
>
> --
> _______________________________________________________________________________
>
> Kristian Sons
> Deutsches Forschungszentrum für Künstliche Intelligenz GmbH, DFKI
> Agenten und Simulierte Realität
> Campus, Geb. D 3 2, Raum 0.77
> 66123 Saarbrücken, Germany
>
> Phone: +49 681 85775-3833
> Phone: +49 681 302-3833
> Fax: +49 681 85775–2235
> kristian.sons at dfki.de
> http://www.xml3d.org
>
> Geschäftsführung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster (Vorsitzender)
> Dr. Walter Olthoff
>
> Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
> Amtsgericht Kaiserslautern, HRB 2313
> _______________________________________________________________________________
>
---
Dr. Johannes Behr
Visual Computing System Technologies
Fraunhofer IGD
Fraunhoferstr. 5 | 64283 Darmstadt | Germany
Tel +49 6151 155-510 | Fax +49 6151 155-196
johannes.behr at igd.fraunhofer.de | www.igd.fraunhofer.de/vcst
More information about the x3d-public
mailing list