GraphicsWindow::polyline() per vertex color doing nothing

GraphicsWindow::polyline() per vertex color doing nothing

svetlin.nikolov
Participant Participant
474 Views
0 Replies
Message 1 of 1

GraphicsWindow::polyline() per vertex color doing nothing

svetlin.nikolov
Participant
Participant

Hey guys,

 

Continuing with the forum threads since I can't submit in ADN as mentioned in another thread.

 

Is it a known issue that GraphicsWindow::polyline()'s 3rd argument (per-vertex color buffer) does nothing, or is there something more exotic that needs to be done in order to make it work? Here is some example code where it seems to be ignored:

 

GraphicsWindow* gw = vpt->getGW();

int savedLimits = gw->getRndLimits();

gw->setRndLimits(savedLimits | GW_COLOR_VERTS); --> Use per vertex colors.

Point3 pts[3] = {Point3(8.5,-15,100), Point3(9.5,-1,101), Point3(10.5,-17,102)};

Point3 cols[3] = {Point3(1,0,0), Point3(0,1,0), Point3(0,0,1)}; --> Red to green to blue expected.

gw.polyline(2, pts, cols, 0, nullptr); gw->setRndLimits(savedLimits);

 

This is expected to have a line that flows from red to green to blue, however the result is a black line. There seems to be a similar issue from 2011 which is unresolved:

https://forums.autodesk.com/t5/3ds-max-programming/graphicswindow-polyline-color/td-p/4029714

 

In case this thread remains unresolved as well, just FYI for the readers - we worked around it using SplineRenderItem.

 

Cheers!

0 Likes
475 Views
0 Replies
Replies (0)