コード例 #1
0
ファイル: Eyes.c プロジェクト: rsaxvc/xDisapprovingEyes
static void
drawEyes(EyesWidget w, TPoint mouse)
{
    TPoint		newpupil[2];
    int			num;

    if (TPointEqual (mouse, w->eyes.mouse)) {
	if (delays[w->eyes.update + 1] != 0)
	    ++w->eyes.update;
	return;
    }
    computePupils (w, mouse, newpupil);
    for (num = 0; num < 2; num ++) {
	drawEye(w, newpupil[num], num);
    }

    w->eyes.mouse = mouse;
    w->eyes.update = 0;
}
コード例 #2
0
//-----------------------------------	
void hairyBeast::draw(){
	if( pVec == NULL ){
		return;
	}
	
	ofPushStyle();
	
		ofPushMatrix();
			
			ofTranslate(pos.x, pos.y, pos.z);
			ofScale(scale.x, scale.y, 1);
			
			ofPushMatrix();
				ofRotate(-rot.z);
				
				globalColors.setColor("darkBlue");		
				for(int i = 0; i < pVec->size(); i++){
					pVec->at(i).draw();
				}

				ofFill();
				img.draw();
				
			ofPopMatrix();

			drawEye(vec.x, vec.y);
			
			ofPushMatrix();
				//TODO: OPTOMIZE!!!!!!!!!!!!!!!!!
				ofRotate(-rot.z);
				for(int k = 0; k < dust.size(); k++){
					dust[k].draw();
				}		
			ofPopMatrix();
			
		ofPopMatrix();	
	
	ofPopStyle();
}