Re: [osg-users] Change color of node read from dxf file

2018-11-21 Thread Robert Osfield
On Wed, 21 Nov 2018 at 20:58, Chris Hanson wrote: > I guess I missed that one. I don't even know what it means to add a Node > as a child of a Drawable so I can't comment on why this works the way it > does. > Geode is really just a Group of Drawable, now that Drawable is a Node, it's

Re: [osg-users] Change color of node read from dxf file

2018-11-21 Thread Chris Hanson
Yeah, that's what I meant. Sorry. ;) On Wed, Nov 21, 2018 at 10:13 PM Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > "... to add a Node as a child of a Drawable ..." > > child of a Geode ;-) .. Now Drawable as a Node can be as a Geode child > > On Wed, Nov 21, 2018 at 9:58 PM

Re: [osg-users] Change color of node read from dxf file

2018-11-21 Thread Trajce Nikolov NICK
"... to add a Node as a child of a Drawable ..." child of a Geode ;-) .. Now Drawable as a Node can be as a Geode child On Wed, Nov 21, 2018 at 9:58 PM Chris Hanson wrote: > I guess I missed that one. I don't even know what it means to add a Node > as a child of a Drawable so I can't comment

Re: [osg-users] Change color of node read from dxf file

2018-11-21 Thread Chris Hanson
I guess I missed that one. I don't even know what it means to add a Node as a child of a Drawable so I can't comment on why this works the way it does. On Wed, Nov 21, 2018 at 10:11 AM Trajce Nikolov NICK < trajce.nikolov.n...@gmail.com> wrote: > It happened when Drawable become a Node > > On

Re: [osg-users] Change color of node read from dxf file

2018-11-21 Thread Trajce Nikolov NICK
It happened when Drawable become a Node On Wed, Nov 21, 2018 at 10:06 AM Alberto Luaces wrote: > Chris Hanson writes: > > > I dunno man, your code is making my head explode. I don't think Geode > HAS an addChild method, so I don't even know why what you're doing would > compile. > > > > I don't

Re: [osg-users] Change color of node read from dxf file

2018-11-21 Thread Alberto Luaces
Chris Hanson writes: > I dunno man, your code is making my head explode. I don't think Geode HAS an > addChild method, so I don't even know why what you're doing would compile. > > I don't think I can help any further. I'm missing something or you are. > Hi, Chris, Geode was subclassed from

Re: [osg-users] Change color of node read from dxf file

2018-11-20 Thread Chris Hanson
I dunno man, your code is making my head explode. I don't think Geode HAS an addChild method, so I don't even know why what you're doing would compile. I don't think I can help any further. I'm missing something or you are. On Tue, Nov 20, 2018 at 5:46 PM Diego Mancilla wrote: > Hi, > > The

Re: [osg-users] Change color of node read from dxf file

2018-11-20 Thread Diego Mancilla
Hi, The suggestion of Chris solve the problem. The actual code: Code: osg::Node* lines = osgDB::readNodeFile("lines.dxf"); osg::Geode* geode = new osg::Geode; ColorVisitor newColor; newColor.setColor( 1.0f, 0.0f, 0.0f ); topography->accept(newColor); geode->addChild(lines);

Re: [osg-users] Change color of node read from dxf file

2018-11-20 Thread Diego Mancilla
Hello Chris, Thank you for your answer. My code, actually compiles, nevertheless I was expecting a conceptual error from my side. I will try what you suggest. Cheers, -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75217#75217

Re: [osg-users] Change color of node read from dxf file

2018-11-19 Thread Chris Hanson
That's not really how it's done. You can't add the Node you got from ReadNodeFile as a child of a Geode. I don't even think that should compile because Geode isn't derive from osg::Group. What you need to do is create a visitor to travel through the children of the "lines" Node (that Node is

[osg-users] Change color of node read from dxf file

2018-11-19 Thread Diego Mancilla
I'm a newbie on OpenSceneGraph and 3D development. I have a dxf file that contains a bunch of 3DPOLYLINES (with different colors). So far I have been able to read and display them on a viewer, but I haven been able to change the color of the rendered lines. I believe that I'm not