Hi,
simple case:
load node with no material (create yourself or delete material from .osg
file)
call getorcreatestateset on node to get stateset
add material to stateset
change material colour
more difficult case:
load node
write visitor to find material and change
even more difficult...
jp
hui wrote:
Message: 9
Date: Mon, 23 Jun 2008 14:41:55 -0400
From: "Gordon Tomlinson" <[EMAIL PROTECTED]
<http://us.mc621.mail.yahoo.com/mc/[EMAIL PROTECTED]>>
Subject: Re: [osg-users] Quick question: how to change the color of a
node.
To: "'OpenSceneGraph Users'" <osg-users@lists.openscenegraph.org
<http://us.mc621.mail.yahoo.com/mc/[EMAIL PROTECTED]>>
Message-ID: <[EMAIL PROTECTED]
<http://us.mc621.mail.yahoo.com/mc/[EMAIL PROTECTED]>>
Content-Type: text/plain; charset="us-ascii"
Some possibilities
1) Could use a shader
2) You could apply a material color
3) You traverse the nodes scene graph, finds it geometry, retrieves the
color arrays and change their values
_____
From: [EMAIL PROTECTED]
<http://us.mc621.mail.yahoo.com/mc/[EMAIL PROTECTED]>
[mailto:[EMAIL PROTECTED]
<http://us.mc621.mail.yahoo.com/mc/[EMAIL PROTECTED]>]
On Behalf Of hui
Sent: Monday, June 23, 2008 2:18 PM
To: osg-users@lists.openscenegraph.org
<http://us.mc621.mail.yahoo.com/mc/[EMAIL PROTECTED]>
Subject: [osg-users] Quick question: how to change the color of a node.
Hi,
Just ask a quick question:
if I use readNodeFile load the cow.osg model, how can I change the color of
the model?
is there any fuction that I can call like in opengl call "glColor3f()"
something?
Thanks in Advance.
Hui
Thanks Gordon
I check the Node reference, if I load a "cow.osg" file, how could I get
the geometry stuff from it, I still not sure? could you tell me?
Thanks
Hui
------------------------------------------------------------------------
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org