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 

Set color for the black lines of a shapefile model


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General [forum]
View previous topic :: View next topic  
Author Message
Ldvp
Newbie


Joined: 01 Sep 2014
Posts: 1

PostPosted: Mon Sep 01, 2014 12:02 pm    Post subject:
Set color for the black lines of a shapefile model
Reply with quote

Hi, I'm a new user needing to load a simple shapefile with a set of geographical lines into my scene. By default its lines are black, while I need to turn them to white.

Looking around in the web and on this forum, I found how to change line thickness usign an LineWidth object set to the model node, but no information on how change line color of a only-lines model.

The Material object seems to not do the job:
Code:
osg::ref_ptr<osg::Node> modelNode = osgDB::readNodeFile(shapefilename);
osg::ref_ptr<osg::Material> nodeMaterial = new osg::Material;
nodeMaterial->setDiffuse (osg::Material::FRONT_AND_BACK, osg::Vec4(1.0, 1.0, 1.0, 1.0));
modelNode->getOrCreateStateSet()->setAttributeAndModes(nodeMaterial, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);


What do you suggest to do?
Thank you!

Cheers,
Luca
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 [forum] 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 wireframe darker wrt the surface color gambr General 0 Tue Mar 21, 2017 4:00 pm View latest post
No new posts Doubt regarding integrating shapefile... vinothrajendran4 VirtualPlanetBuilder [vpb] 5 Thu Feb 16, 2017 2:10 pm View latest post
No new posts problem with shapefile height when lo... vinothrajendran4 General 2 Thu Feb 16, 2017 12:22 pm View latest post
No new posts Secondary Color not working? umesh General 0 Tue Feb 14, 2017 10:37 am View latest post
No new posts issue with 3ds model after upgrading ... filnet General 5 Thu Feb 09, 2017 1:27 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