[osg-users] How to set the size of a point in osg?

2008-11-20 Thread Ruqin Zhang
Hi, I couldn't find any function to set the point size, can anyone help? Here is the code: osg::ref_ptrosg::Geometry averageGeom = new osg::Geometry(); averageGeom-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet:POINTS, 0, averageArray-size())); In this way, it will draw the points based

Re: [osg-users] How to set the size of a point in osg?

2008-11-20 Thread Glenn Waldron
Try something like this: averageGeom-getOrCreateStateSet()-setAttribute( new osg::Point( 3.0f ), osg::StateAttribute::ON ); Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : +1.703.652.4791 On Thu, Nov 20, 2008 at 5:02 PM, Ruqin Zhang [EMAIL PROTECTED] wrote: Hi, I couldn't

Re: [osg-users] How to set the size of a point in osg?

2008-11-20 Thread Ferdi Smit
Just to be complete, you can also set it in the vertex shader by writing to gl_Pointsize; however, in that case, you have to enable GL_VERTEX_PROGRAM_POINT_SIZE by setMode(GL_VERTEX_PROGRAM_POINT_SIZE, osg:: StateAttribute::ON); on a stateset. Ruqin Zhang wrote: Hi, I couldn't find any

Re: [osg-users] How to set the size of a point in osg?

2008-11-20 Thread Ruqin Zhang
Thanks guys. Then how about Line? Seems there is no osg::Line. Thanks! On Thu, Nov 20, 2008 at 4:33 PM, Ferdi Smit [EMAIL PROTECTED] wrote: Just to be complete, you can also set it in the vertex shader by writing to gl_Pointsize; however, in that case, you have to enable

Re: [osg-users] How to set the size of a point in osg?

2008-11-20 Thread Glenn Waldron
Look at osg::LineWidth Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : +1.703.652.4791 On Thu, Nov 20, 2008 at 5:40 PM, Ruqin Zhang [EMAIL PROTECTED] wrote: Thanks guys. Then how about Line? Seems there is no osg::Line. Thanks! On Thu, Nov 20, 2008 at 4:33 PM, Ferdi Smit