MCPcopy Create free account
hub / github.com/cinder/Cinder / drawFrames

Method drawFrames

samples/Tubular/src/Tube.cpp:198–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198void Tube::drawFrames( float lineLength, float lineWidth )
199{
200 if( mPs.empty() || mFrames.empty() )
201 return;
202
203 gl::lineWidth( lineWidth );
204 gl::begin( GL_LINES );
205 for( int i = 0; i < ( mPs.size() - 1 ); ++i ) {
206
207 vec3 xAxis = vec3( mFrames[i] * vec4( 1, 0, 0, 0 ) );
208 vec3 yAxis = vec3( mFrames[i] * vec4( 0, 1, 0, 0 ) );
209 vec3 zAxis = vec3( mFrames[i] * vec4( 0, 0, 1, 0 ) );
210
211 gl::lineWidth( lineWidth );
212 gl::color( Color( 1, 0.5f, 0 ) );
213 gl::vertex( mPs[i] );
214 gl::vertex( mPs[i] + xAxis * lineLength );
215
216 gl::color( Color( 1, 0, 1 ) );
217 gl::vertex( mPs[i] );
218 gl::vertex( mPs[i] + yAxis * lineLength );
219
220 gl::lineWidth( 2*lineWidth );
221 gl::color( Color( 0, 1, 1 ) );
222 gl::vertex( mPs[i] );
223 gl::vertex( mPs[i] + zAxis * lineLength );
224 }
225 gl::end();
226}
227
228void Tube::drawFrameSlices( float scale )
229{

Callers 1

drawMethod · 0.80

Calls 8

lineWidthFunction · 0.50
beginFunction · 0.50
colorFunction · 0.50
ColorFunction · 0.50
vertexFunction · 0.50
endFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected