[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AW: [x3d-public] containerField
- Subject: AW: [x3d-public] containerField
- From: "Mirko Gontek" <mgontek@yahoo.de>
- Date: Thu, 2 Mar 2006 17:26:41 +0100
- Cc: "'X3D PUBLIC'" <x3d-public@web3d.org>
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.de; h=Received:From:Cc:Subject:Date:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:X-MimeOLE:In-Reply-To:Thread-Index; b=J3iihGJdFB9Ty8lyCIvWxZJddPlKHsu8cfPn+IMtrixh0FQM1pEBh26MmQqOMJEfYZV+3xZcPmAVI/sdVUz0PNmM44sWbiHHIyezGl0y7QWJro5hHXXcOzeqqLgQjNwPWJNoq3UvfjgFbqF88i6eVDOBwiEBD4T4ssjjk9LBZ9I= ;
- In-reply-to: <44070E2F.5090309@yumetech.com>
- Sender: owner-x3d-public@web3d.org
- Thread-index: AcY+DZfdt+w6XZVwSd2VCYAYT5Wr6QACFtEg
thank you! maybe someone can help me with another problem....
i try to create a scenegraph with sai that looks like this:
<Transform>
<Shape>
<Sphere/>
</Shape>
<TouchSensor/>
</Transform>
i did this:
//create Shape
X3DNode shape = mainScene.createNode("Shape");
SFNode shape_geometry = (SFNode) (shape.getField("geometry"));
X3DNode sphere = mainScene.createNode("Sphere");
shape_geometry.setValue(sphere);
//create TouchSensor
X3DNode touch = mainScene.createNode("TouchSensor");
//create Transform
X3DNode transf = mainScene.createNode("Transform");
//add shape and touchSensor as children to Transform
MFNode ch = (MFNode)transf.getField("children"); //or
addChildren
ch.setValue(2, new X3DNode[] {shape, touch });
//add Transform to Scene
mainScene.addRootNode(transf);
but: where are the children? they are visible, but here nothing appears:
MFNode children = (MFNode)transf.getField("children");
for(int j=0; j<children.size();j++){
X3DNode n = children.get1Value(j);
System.out.println(n.getNodeName());
}
and: when walking the scenegraph with rootNodes as parameter (like in the
SAISGWalkDemo) it does not work:
X3DNode[] roots = mainScene.getRootNodes();
walkSG(roots);
i thought that getRootNodes() returned all Nodes of the Scene. is that
wrong? if yes, how can i achieve this? what would be the correct way to
make all nodes of the scene available (also the children of the transform)?
-----Ursprüngliche Nachricht-----
Von: Alan Hudson [mailto:giles@yumetech.com]
Gesendet: Donnerstag, 2. März 2006 16:25
An: Mirko Gontek
Cc: 'X3D PUBLIC'
Betreff: Re: [x3d-public] containerField
Mirko Gontek wrote:
> hi all,
> i have two questions. first, there are "fields" in x3d which do not
> occur in the specification. e.g. "containerField" in MetadataString:
>
> <MetadataString name="myName" reference="name" containerField="xyz"/>
>
> but according to the spec "containerField" is not a field:
>
> MetadataString : X3DNode, X3DMetadataObject {
> SFNode [in,out] metadata NULL [X3DMetadataObject]
> SFString [in,out] name ""
> SFString [in,out] reference ""
> MFString [in,out] value []
> }
>
> why this?
>
> and second, how can i access these fields with sai? i'd like to create
> a MetadataSet which looks like this:
>
> <MetadataSet>
> <MetadataString name="myName" reference="name" containerField="value"/>
> <MetadataString name="myType" reference="type"
> containerField="value"/> </MetadataSet>
>
> i could not find any information about what containerField actually
> is, but apparently the containerField is required (i adopted it from
> the conformance examples). could you give me a hint? and how can i access
containerField?
>
containerField is only needed in the XML encoding. Sometimes you need this
field to tell the parser what field the node goes into. The most common
case is Collision. There you need to specify whether a field is part of the
proxy or children field.
<Collision>
<Shape containerField="proxy"><Box /></Shape>
<Shape>
<IndexedFaceSet ...
</Shape>
</Collision>
without the containerField the Box would have gone into the children field
of the collision node instead of the proxy field.
You never need SAI access to this.
--
Alan Hudson
President Yumetech, Inc. www.yumetech.com
President Web3D Consortium www.web3d.org
206 340 8900
___________________________________________________________
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
-------------------------------------------------------------------------
for list subscription/unsubscription,
go to http://www.web3d.org/cgi-bin/public_list_signup/lwgate/listsavail.html