[Closed] SDK: Render shaded polygon inside wireframe viewport?
I have a SimpleObject2 plugin that I want to always be displayed in shaded mode, no matter whether the user has changed the viewport to wireframe mode.
I’ve successfully been able to draw triangles to a wireframe viewport by using gw->triangle() but I can’t figure out how to put a texture on those triangles.
Alternatively, I tried just using mesh.render to the GW, but the function seems to ignore the GW_WIREFRAME flag. I tried disabling it by including “& ~GW_WIREFRAME” in my render limits, but it didn’t seem to disable wireframe mode in the resulting render.
Anybody have experience with this? My goal is to draw a quad in all viewports, ignoring their specific shading modes, that has a texture on it.
Got it working…
In case anyone else ever has this same problem, here is a code snippet showing how I got the GraphicsWindow triangles to draw with a texture in all viewports (including wireframe views):
Inside my SimpleObject2:: Display function…
Material m;
GetCOREInterface()->ConvertMtl(t, m, inode->GetMtl(), TRUE, 1, 1, needDecal, inode, NULL, vpt->getGW());
gw->setMaterial(m);
gw->startTriangles();
gw->triangleN(vtx, nrm, uvw);
gw->endTriangles();