Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color #56

Open
Krosyus opened this issue Mar 7, 2022 · 4 comments
Open

Color #56

Krosyus opened this issue Mar 7, 2022 · 4 comments

Comments

@Krosyus
Copy link

Krosyus commented Mar 7, 2022

Hello ^^
I placed myself underwater and I would like to know why I can not put colors on my 2 ShapeDrawable object I tried without osgOcean and its works but on the example nothing passes as expected I may have forgotten an essential point '

here is my code if needed in the source file application.cpp before the "Set up the viewer": (nothing extraordinary)

osg::ref_ptr<osg::ShapeDrawable> cubeMap = new osg::ShapeDrawable();
osg::ref_ptr<osg::ShapeDrawable> cylinderMap = new osg::ShapeDrawable();
osg::ref_ptr<osg::Group> rootGroup = new osg::Group();

cubeMap->setShape(new osg::Box(osg::Vec3(0.0f, 0.0f, -210.0f), 2.0f));
cylinderMap->setShape(new osg::Cylinder(osg::Vec3(5.0f, 0.0f, -210.0f), 1.0f, 8.0f));
cubeMap->setColor(osg::Vec4f(1.0f, 0.0f, 0.0f, 0.0f));
cylinderMap->setColor(osg::Vec4f(1.0f,0.0f,1.0f,0.0f));
cylinderMap->setColorBinding(osg::Geometry::BIND_OVERALL);

osg::ref_ptr<osg::Geode> geode = new osg::Geode;
geode->addDrawable(cubeMap.get());
geode->addDrawable(cylinderMap.get());

scene->getOceanScene()->addChild(geode);
root->addChild(scene->getScene());

thanks in advance

@kbale
Copy link
Owner

kbale commented Mar 7, 2022 via email

@Krosyus
Copy link
Author

Krosyus commented Mar 7, 2022

Oh

Allright, I’ll see what I can do.
Thanks

@kbale
Copy link
Owner

kbale commented Mar 7, 2022 via email

@Krosyus
Copy link
Author

Krosyus commented Mar 7, 2022

HOOOOO

Copy and modify the base shader
Okay thanks for the tips

Have a nice day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants