Julapy I’ve put your code to work on a circular transparency gradient, and it works a treat thanks for posting!
I have a quick question, hope this makes sense. I’m looking through the code to see how I can scale the size of the texture dynamically.
The diagram below shows the relationship I’m looking to change. X is the height of the original png, which relates to the ‘thickness’ of the circle once rotated. I’d like to know how to stretch/compress the thickness of the circle, based on a sensor reading I’m passing to the object.
I’ve changed this section in the constructor, which seems to scale the whole png upon loading
for( int i=0; i<circle.size(); i++ )
outerRim.push_back( circle[ i ] + normals[ i ] * 40 );
innerRim.push_back( circle[ i ] - normals[ i ] * 40 );
and glScalef works well to change the radius of the circle
void testApp :: drawRing (float size)
glScalef( size,size,1 );
Any ideas on how I might scale the vertical dimension of the texture, to make the circle thicker or thinner?