Hi Johan,
On Thu, 2007-08-23 at 11:29 +0200, Johan Robben wrote:
> Hi all,
> I have a question about the loading of VRML.
first off, OpenSG is not a VRML viewer and does not intend to be one.
Although there is a VRML loader, it only aims to load geometry stored in
the vrml format and interprets only a certain subset of all possible
vrml nodes.
> When I load a file which contains (among other things) the following:
> DEF MY_CONE Cone {
> field SFFloat bottomRadius 1 # (0,)
> field SFFloat height 2 # (0,)
> field SFBool side FALSE
> field SFBool bottom TRUE
> }
> Suppose I want to change the ‘side’ field of this cone after loading
> the VRML.
> How is this done?
you would have to locate the geometry OpenSG has created and replace it
with a new one (created e.g. by OSG::makeCone from OSGSimpleGeometry.h)
that has the right number of sides.
> I’m able to find the node CONE, but if I want to change the ‘side’
> field by doing this:
> Field * field = node->getCore()->getField(targetAttributeString.c_str
> ()); //where targetAttributeString = “side”
> The field is not found.
Yes, you are dealing with an OpenSG Node/NodeCore and only the fields
they define are available.
> Is the VRML information lost after loading ?
As far as I know that is the case, some of it might be kept around in
attachments, but I'm not familiar enough with the VRML loader to give a
definite answer. May someone can chip in here, please?
> If not, how can I retrieve and change it ?
As I said above, locate the created geometry and replace it. Maybe
someone else has a better idea?
Hope it helps,
Carsten
PS: Please do not send HTML mail to this list, thank you.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users