Skip to content

LineDrawable color by vertex #1842

Answered by gwaldron
miles-tbe asked this question in Support Q&A
Discussion options

You must be logged in to vote

You can use void setColor(unsigned i, const osg::Vec4& color) to set the color at a specific index.

Another way of building the line would be something like...

line->allocate(total_num_verts);
for(int i=0; i<total_num_verts; ++i) {
    line->setVertex(i, value);
    line->setColor(i, color);
    ....
}

Hope this helps!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@miles-tbe
Comment options

Answer selected by miles-tbe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants