OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Change color of node read from dxf file


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
dhhabyc
User


Joined: 17 Nov 2018
Posts: 24

PostPosted: Sat Nov 17, 2018 12:58 pm    Post subject:
Change color of node read from dxf file
Reply with quote

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 understanding properly the graph relationships.

I'm using the "Quick Start Guide" as reference and modifying an example that I found on the web.

A code snippet of what I have:

Code:
osg::ref_ptr<osg::Geometry> geom = new osg::Geometry;
osg::ref_ptr<osg::Vec4Array> c = new osg::Vec4Array;
geom->setColorArray(c.get());
geom->setColorBinding(osg::Geometry::BIND_OVERALL);
c->push_back(osg::Vec4(1.f, 0.f, 0.f, 1.f));

osg::ref_ptr<osg::Vec3Array> n = new osg::Vec3Array;
geom->setNormalArray(n.get());
geom->setNormalBinding(osg::Geometry::BIND_OVERALL);
n->push_back(osg::Vec3(0.f, -1.f, 0.f));

osg::Node* lines = osgDB::readNodeFile("lines.dxf");
osg::Geode* geode = new osg::Geode;

geode->addChild(lines);
geode->addDrawable(geom.get());

std::cout << "Num Drawables in geode: " << geode->getNumDrawables() << std::endl;

osg::Camera* camera = new osg::Camera;
camera->setViewport(0, 0, this->width(), this->height());
camera->setClearColor(osg::Vec4(0.9f, 0.9f, 1.f, 1.f));
float aspectRatio = static_cast<float>(this->width()) / static_cast<float>(this->height());
camera->setProjectionMatrixAsPerspective(30.f, aspectRatio, 1.f, 1000.f);
camera->setGraphicsContext(_mGraphicsWindow);

_mViewer->setCamera(camera);
_mViewer->setSceneData(geode);
osgGA::TrackballManipulator* manipulator = new osgGA::TrackballManipulator;
manipulator->setAllowThrow(false);
this->setMouseTracking(true);
_mViewer->setCameraManipulator(manipulator);
_mViewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
_mViewer->realize();


Thank you!

Cheers.
Back to top
View user's profile Send private message
Chris Hanson
Guest





PostPosted: Mon Nov 19, 2018 9:55 pm    Post subject:
Change color of node read from dxf file
Reply with quote

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 almost 100% certain to be an osg::Group with many children), finding any osg::Nodes you are interested in and examining how the color is set up on them (per-vertex, overall, etc) and changing the color data there.




At a glance, this old example shows sort of what I'm talking about, but it may need tweaking to compile with current sources: http://forum.openscenegraph.org/viewtopic.php?t=10590&view=next



On Mon, Nov 19, 2018 at 10:56 AM Diego Mancilla < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
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 understanding properly the graph relationships.

 I'm  using the "Quick Start Guide" as reference and modifying an example that I found on the web.

 A code snippet of what I have:


Code:
osg::ref_ptr<osg::Geometry> geom = new osg::Geometry;
osg::ref_ptr<osg::Vec4Array> c = new osg::Vec4Array;
geom->setColorArray(c.get());
geom->setColorBinding(osg::Geometry::BIND_OVERALL);
c->push_back(osg::Vec4(1.f, 0.f, 0.f, 1.f));

osg::ref_ptr<osg::Vec3Array> n = new osg::Vec3Array;
geom->setNormalArray(n.get());
geom->setNormalBinding(osg::Geometry::BIND_OVERALL);
n->push_back(osg::Vec3(0.f, -1.f, 0.f));

osg::Node* lines = osgDB::readNodeFile("lines.dxf");
osg::Geode* geode = new osg::Geode;

geode->addChild(lines);
geode->addDrawable(geom.get());

std::cout << "Num Drawables in geode: " << geode->getNumDrawables() << std::endl;

osg::Camera* camera = new osg::Camera;
camera->setViewport(0, 0, this->width(), this->height());
camera->setClearColor(osg::Vec4(0.9f, 0.9f, 1.f, 1.f));
float aspectRatio = static_cast<float>(this->width()) / static_cast<float>(this->height());
camera->setProjectionMatrixAsPerspective(30.f, aspectRatio, 1.f, 1000.f);
camera->setGraphicsContext(_mGraphicsWindow);

_mViewer->setCamera(camera);
_mViewer->setSceneData(geode);
osgGA::TrackballManipulator* manipulator = new osgGA::TrackballManipulator;
manipulator->setAllowThrow(false);
this->setMouseTracking(true);
_mViewer->setCameraManipulator(manipulator);
_mViewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
_mViewer->realize();



Thank you!

Cheers.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75209#75209





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]

------------------
Post generated by Mail2Forum
Back to top
dhhabyc
User


Joined: 17 Nov 2018
Posts: 24

PostPosted: Tue Nov 20, 2018 12:04 pm    Post subject:
Reply with quote

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,
Back to top
View user's profile Send private message
dhhabyc
User


Joined: 17 Nov 2018
Posts: 24

PostPosted: Tue Nov 20, 2018 4:47 pm    Post subject:
Reply with quote

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);
_mViewer->setSceneData(geode);
_mViewer->realize();


Where ColorVisitor is a derived class from osg::NodeVistor:

Code:


class ColorVisitor : public osg::NodeVisitor
{
public:
ColorVisitor();
ColorVisitor(const osg::Vec4 &color);
virtual ~ColorVisitor();
virtual void ColorVisitor::apply(osg::Node &node);
virtual void ColorVisitor::apply(osg::Geode &geode);
virtual void ColorVisitor::setColor(const float r, const float g, const float b, const float a = 1.0f);
virtual void ColorVisitor::setColor(const osg::Vec4 &color);

private:
osg::Vec4 m_color;
osg::ref_ptr< osg::Vec4Array > m_colorArrays;


and the implementation:

Code:

#include "ColorVisitor.h"

ColorVisitor::ColorVisitor(): osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {
m_color.set(1.0, 1.0, 1.0, 1.0);
m_colorArrays = new osg::Vec4Array;
m_colorArrays->push_back(m_color);
};

ColorVisitor::ColorVisitor(const osg::Vec4 &color): osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN){
m_color = color;
m_colorArrays = new osg::Vec4Array;
m_colorArrays->push_back(m_color);
};

ColorVisitor::~ColorVisitor(){};

void ColorVisitor::apply(osg::Node &node) {
traverse(node);
};

void ColorVisitor::apply(osg::Geode &geode) {
osg::StateSet *state = NULL;
unsigned int vertNum = 0;
unsigned int numGeoms = geode.getNumDrawables();

for (unsigned int geodeIdx = 0; geodeIdx < numGeoms; geodeIdx++) {
if (curGeom) {
osg::Vec4Array *colorArrays = dynamic_cast<osg::Vec4Array *>(curGeom->getColorArray());
if (colorArrays) {
for (unsigned int i = 0; i < colorArrays->size(); i++) {
osg::Vec4 *color = &colorArrays->operator [](i);
color->set(m_color._v[0], m_color._v[1], m_color._v[2], m_color._v[3]);
}
}
else {
curGeom->setColorArray(m_colorArrays.get());
curGeom->setColorBinding(osg::Geometry::BIND_OVERALL);
}
}
}
};

void ColorVisitor::setColor(const float r, const float g, const float b, const float a) {

osg::Vec4 *c = &m_colorArrays->operator [](0);
m_color.set(r, g, b, a);
*c = m_color;

};

void ColorVisitor::setColor(const osg::Vec4 &color) {

osg::Vec4 *c = &m_colorArrays->operator [](0);
m_color = color;
*c = m_color;
};


The ColorVistor class I took it from Gordon Tomlison's OSG Samples (cant post links yet)

One thing stills bother me. If I dont use the line
Code:
geode->addChild(lines)
and instead I pass directly the node to the viewer
Code:
_mViewer->setSceneData(lines);
the application crashes. Can anyone tell why this is happening?

Thank you!
PS: Sorry I coudnt get the code blocks indented... :(

Cheers,
Back to top
View user's profile Send private message
Chris Hanson
Guest





PostPosted: Tue Nov 20, 2018 9:46 pm    Post subject:
Change color of node read from dxf file
Reply with quote

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 < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
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);
_mViewer->setSceneData(geode);
_mViewer->realize();




Where ColorVisitor is a derived class from osg::NodeVistor:


Code:


class ColorVisitor : public osg::NodeVisitor
{
public:
ColorVisitor();
ColorVisitor(const osg::Vec4 &color);
virtual ~ColorVisitor();
virtual void ColorVisitor::apply(osg::Node &node);
virtual void ColorVisitor::apply(osg::Geode &geode);
virtual void ColorVisitor::setColor(const float r, const float g, const float b, const float a = 1.0f);
virtual void ColorVisitor::setColor(const osg::Vec4 &color);

private:
osg::Vec4 m_color;
osg::ref_ptr< osg::Vec4Array > m_colorArrays;



and the implementation:


Code:

#include "ColorVisitor.h"

ColorVisitor::ColorVisitor(): osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {
m_color.set(1.0, 1.0, 1.0, 1.0);
m_colorArrays = new osg::Vec4Array;
m_colorArrays->push_back(m_color);
};

ColorVisitor::ColorVisitor(const osg::Vec4 &color): osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN){
m_color = color;
m_colorArrays = new osg::Vec4Array;
m_colorArrays->push_back(m_color);
};

ColorVisitor::~ColorVisitor(){};

void ColorVisitor::apply(osg::Node &node) {
traverse(node);
};

void ColorVisitor::apply(osg::Geode &geode) {
osg::StateSet *state = NULL;
unsigned int vertNum = 0;
unsigned int numGeoms = geode.getNumDrawables();

for (unsigned int geodeIdx = 0; geodeIdx < numGeoms; geodeIdx++) {
if (curGeom) {
osg::Vec4Array *colorArrays = dynamic_cast<osg::Vec4Array *>(curGeom->getColorArray());
if (colorArrays) {
for (unsigned int i = 0; i < colorArrays->size(); i++) {
osg::Vec4 *color = &colorArrays->operator [](i);
color->set(m_color._v[0], m_color._v[1], m_color._v[2], m_color._v[3]);
}
}
else {
curGeom->setColorArray(m_colorArrays.get());
curGeom->setColorBinding(osg::Geometry::BIND_OVERALL);
}
}
}
};

void ColorVisitor::setColor(const float r, const float g, const float b, const float a) {

osg::Vec4 *c = &m_colorArrays->operator [](0);
m_color.set(r, g, b, a);
*c = m_color;

};

void ColorVisitor::setColor(const osg::Vec4 &color) {

osg::Vec4 *c = &m_colorArrays->operator [](0);
m_color = color;
*c = m_color;
};



The ColorVistor class I took it from Gordon Tomlison's OSG Samples (cant post links yet)

One thing stills bother me. If I dont use the line
Code:
geode->addChild(lines)

 and instead I pass directly the node to the viewer

Code:
_mViewer->setSceneData(lines);

 the application crashes. Can anyone tell why this is happening?

Thank you!
PS: Sorry I coudnt get the code blocks indented... Sad

Cheers,

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75219#75219





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]

------------------
Post generated by Mail2Forum
Back to top
Alberto Luaces
Guest





PostPosted: Wed Nov 21, 2018 9:06 am    Post subject:
Change color of node read from dxf file
Reply with quote

Chris Hanson writes:

Quote:
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 Group some time ago, see

https://github.com/openscenegraph/OpenSceneGraph/commit/3dde165f140ab5f973e50709235cf40c4862bc17

I don't remember exactly the rationale, but it was about making the code
more straightforward.

--
Alberto



------------------
Post generated by Mail2Forum
Back to top
Trajce Nikolov NICK
Guest





PostPosted: Wed Nov 21, 2018 9:12 am    Post subject:
Change color of node read from dxf file
Reply with quote

It happened when Drawable become a Node


On Wed, Nov 21, 2018 at 10:06 AM Alberto Luaces < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Chris Hanson writes:

Quote:
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 Group some time ago, see

https://github.com/openscenegraph/OpenSceneGraph/commit/3dde165f140ab5f973e50709235cf40c4862bc17

I don't remember exactly the rationale, but it was about making the code
more straightforward.

--
Alberto

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


--
trajce nikolov nick

------------------
Post generated by Mail2Forum
Back to top
Chris Hanson
Guest





PostPosted: Wed Nov 21, 2018 8:58 pm    Post subject:
Change color of node read from dxf file
Reply with quote

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 < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
It happened when Drawable become a Node


On Wed, Nov 21, 2018 at 10:06 AM Alberto Luaces < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Chris Hanson writes:

Quote:
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 Group some time ago, see

https://github.com/openscenegraph/OpenSceneGraph/commit/3dde165f140ab5f973e50709235cf40c4862bc17

I don't remember exactly the rationale, but it was about making the code
more straightforward.

--
Alberto

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


--
trajce nikolov nick

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]

------------------
Post generated by Mail2Forum
Back to top
Trajce Nikolov NICK
Guest





PostPosted: Wed Nov 21, 2018 9:14 pm    Post subject:
Change color of node read from dxf file
Reply with quote

"... to add a Node as a child of a Drawable ..."


child of a Geode Wink .. Now Drawable as a Node can be as a Geode child

On Wed, Nov 21, 2018 at 9:58 PM Chris Hanson < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
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 < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
It happened when Drawable become a Node


On Wed, Nov 21, 2018 at 10:06 AM Alberto Luaces < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Chris Hanson writes:

Quote:
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 Group some time ago, see

https://github.com/openscenegraph/OpenSceneGraph/commit/3dde165f140ab5f973e50709235cf40c4862bc17

I don't remember exactly the rationale, but it was about making the code
more straightforward.

--
Alberto

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


--
trajce nikolov nick

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]






_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
trajce nikolov nick

------------------
Post generated by Mail2Forum
Back to top
Chris Hanson
Guest





PostPosted: Wed Nov 21, 2018 9:30 pm    Post subject:
Change color of node read from dxf file
Reply with quote

Yeah, that's what I meant. Sorry. Wink

On Wed, Nov 21, 2018 at 10:13 PM Trajce Nikolov NICK < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
"... to add a Node as a child of a Drawable ..."


child of a Geode Wink .. Now Drawable as a Node can be as a Geode child

On Wed, Nov 21, 2018 at 9:58 PM Chris Hanson < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
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 < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
It happened when Drawable become a Node


On Wed, Nov 21, 2018 at 10:06 AM Alberto Luaces < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Chris Hanson writes:

Quote:
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 Group some time ago, see

https://github.com/openscenegraph/OpenSceneGraph/commit/3dde165f140ab5f973e50709235cf40c4862bc17

I don't remember exactly the rationale, but it was about making the code
more straightforward.

--
Alberto

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


--
trajce nikolov nick

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]






_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
trajce nikolov nick

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]

------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12323

PostPosted: Thu Nov 22, 2018 7:43 am    Post subject:
Change color of node read from dxf file
Reply with quote

On Wed, 21 Nov 2018 at 20:58, Chris Hanson < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
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 essentially just a Group of Nodes... which means that you can happily just use Group instead of Geode  Geode will be kept around for backwards compatibility.


Having Drawable a Node and usable directly in the scene graph as any normal child Node simplifies the scene graph structurally and should simplify learning the OSG as you can just assign a Drawable to a Viewer via setSceneData(), or just add a Drawable to a Group, no need to learn about a "special" Geode that was never "special" in the first place.


Robert.





 


 

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Different colors for a node shared sc... icf80 General 1 Thu Jun 13, 2019 12:49 pm View latest post
No new posts Convert .earth file to .osg format stevenj279 General 29 Mon Apr 22, 2019 5:05 am View latest post
No new posts Attaching color buffer with GL_R32F i... deroliver General 0 Tue Apr 09, 2019 6:19 pm View latest post
No new posts EditorConfig file? AnyOldName3 General 13 Thu Mar 14, 2019 12:02 am View latest post
No new posts Deep cloning an active root scene node Robert Lockyer General 7 Thu Feb 28, 2019 5:52 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP