Example #1
0
//----------------------------------------------------------
void ofPath::rectangle(const ofRectangle & r){
	moveTo(r.getTopLeft());
	lineTo(r.getTopRight());
	lineTo(r.getBottomRight());
	lineTo(r.getBottomLeft());
	close();
}
void Dimentions::drawBrakets(ofRectangle _rect, float size, float margin){
    
    ofPushStyle();
    ofSetLineWidth(2);
    
    ofPushMatrix();
    ofTranslate(_rect.getTopLeft() + ofPoint(-margin,-margin));
    ofLine(0, 0, size, 0);
    ofLine(0, 0, 0, size);
    ofPopMatrix();
    
    ofPushMatrix();
    ofTranslate(_rect.getTopRight() + ofPoint(margin,-margin));
    ofLine(0, 0, -size, 0);
    ofLine(0, 0, 0, size);
    ofPopMatrix();
    
    ofPushMatrix();
    ofTranslate(_rect.getBottomLeft() + ofPoint(-margin,margin));
    ofLine(0, 0, size, 0);
    ofLine(0, 0, 0, -size);
    ofPopMatrix();
    
    ofPushMatrix();
    ofTranslate(_rect.getBottomRight() + ofPoint(margin,margin));
    ofLine(0, 0, -size, 0);
    ofLine(0, 0, 0, -size);
    ofPopMatrix();
    
    ofPopStyle();
}
Example #3
0
// Temporary fix until OF 0.8.0
static void rectangle(ofPath & path, const ofRectangle & r){
	path.moveTo(r.getTopLeft());
	path.lineTo(r.getTopRight());
	path.lineTo(r.getBottomRight());
	path.lineTo(r.getBottomLeft());
	path.close();
}
Example #4
0
//--------------------------------------------------------------
void pbPushRect( const ofPoint &p1, const ofPoint &p2, const ofPoint &p3, const ofPoint &p4,
                const ofRectangle &texRect,
                vector<ofPoint> &points, vector<ofVec2f> &texs ) {
    points.push_back( p1 );
    points.push_back( p2 );
    points.push_back( p3 );
    points.push_back( p4 );
    
    texs.push_back( texRect.getTopLeft() );
    texs.push_back( texRect.getTopRight() );
    texs.push_back( texRect.getBottomRight() );
    texs.push_back( texRect.getBottomLeft() );
}
Example #5
0
//--------------------------------------------------------------
//текстурированные прямоугольники
void pbPushRect( const ofPoint &p, const ofPoint &w, const ofPoint &h,
                const ofRectangle &texRect,
                vector<ofPoint> &points, vector<ofVec2f> &texs )
{
    points.push_back( p );
    points.push_back( p + w );
    points.push_back( p + w + h );
    points.push_back( p + h );
    
    texs.push_back( texRect.getTopLeft() );
    texs.push_back( texRect.getTopRight() );
    texs.push_back( texRect.getBottomRight() );
    texs.push_back( texRect.getBottomLeft() );
}
Example #6
0
//--------------------------------------------------------------
void pbPushRect( float x, float y, float z, float w, float h,
                const ofRectangle &texRect,
                vector<ofPoint> &points, vector<ofVec2f> &texs )
{
    points.push_back( ofPoint( x, y, z ) );
    points.push_back( ofPoint( x + w, y, z ) );
    points.push_back( ofPoint( x + w, y + h, z ) );
    points.push_back( ofPoint( x, y + h, z ) );
    
    texs.push_back( texRect.getTopLeft() );
    texs.push_back( texRect.getTopRight() );
    texs.push_back( texRect.getBottomRight() );
    texs.push_back( texRect.getBottomLeft() );
    
}