Hi,

I think I have a simple question:

        I have some textures. Now I will that they are presented for all nodes
to use in the actual aplication, instatiate by name. I think a way to do
that is to put the textures in a GroupNode, and then put it in the
scenegraph to send around. For not rendering I will set: 

        groupnode->setActive(false);

Here is peace of Code for that:
                

setUpTextureGoup(NodePtr act_tex_nd){
        
 MaterialGroupPtr tex_temp = MaterialGroup::create();

...
  tex_temp->setMaterial(MaterialGroupPtr::dcast
        (act_tex_nd->getCore())->getMaterial()); 
...

...
 if (this->texture_group == NullFC)
    this->texture_group = Node::create();
...
 this->texture_group->setCore(Group::create());
 this->texture_group->addChild(tex_temp);
...
 this->texture_group->setActive(false);
    
...

Did I need a geometry represention for to hold the texture, or will the
GroupNode enough so that I can put it into the scenegraph:

 mgr->getRoot()->addChild(this->texture_group);

}


(The dots are for beginEditCP or endEditCP)

So this texture_group should be able to hold lots of textures and then
instantiate by a name like:

    metal or glas

Can someone help, if this is a good way for to do that? I haven't
implemented it right now, so I can not say if it works?

Bye Marc



-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to