Hi Nie,
Hi all,
   I am now working with osg::viewer for 3D model rendering.
   As shown in the following sample image, for a single object, is it possible 
to render in gradation color along a random direction(now it is along the 
arrow).
Although it is only divided into 5 colors in the sample image, continuous color 
is also acceptable.
Can I achieve this by adjust the parameter of the model( material or lighting)?
Or I have to write new a osg::viewer::frame() function?
If anyone knows how to complete this idea, I am looking forward for your answer.
If you need continuous coloring and your geometry is a cube, simply set the vertex colors appropriate. Another option without touching the geometry at all is to assign the color in the vertex shader based on the desired vertex coordinates (i.e. red = vertex_z) Third option is to use a texture, and again without modification you can use built in texture coordinate generation in object_space

Cheers
Sebastian

...

Thank you!

Cheers,
[/img]

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




Attachments:
http://forum.openscenegraph.org//files/grad_109.png


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to