Drawing a Bounding Box (Noob's corner)

Hi all,

I’d like to draw a bounding box for my scene.

void BasicApp::setup()
{
[…]

auto lambert = gl::ShaderDef().lambert().color();
gl::GlslProgRef shader = gl::getStockShader(lambert);


auto cube = geom::Cube().size(20, 20, 20);
m_boundingBoxRef = gl::Batch::create(cube, shader);

}

This draws a solid shaded box.
What I’d like to draw is just the edges, I’m guessing that there’re might be a different shader I should use but I’m not sure.

Your help is appreciated.

Hi Allo.

have you tried

geom::WireCube() ?

Best.

Thanks @felixfaire.
So I replaced my geom::Cube() with geom::WireCube() like you suggested, but now it draws nothing.
I looked to see if I could set set wires’s thickness, but no luck.

Cheers.

Mmm. Perhaps using

gl::bindStockShader( gl::ShaderDef().color() );

instead of the lambert shader might help. Are you also setting a color / alpha before the draw call?