示例#1
0
文件: source.cpp 项目: KovaxG/ACAD
void display(void) {
    glClear(GL_COLOR_BUFFER_BIT);
    glPushMatrix();

    // Wind
    wind.draw();

    // Wires
    w[0].draw();
    w[1].draw();
    w[2].draw();

    // Air duct
    glColor3f WHITE;
    glLine(ADOffset, ADOffset, WIDTH - ADOffset, ADOffset);
    glLine(ADOffset, ADOffset + ADHeight, WIDTH - ADOffset, ADOffset + ADHeight);

    // Air sensor - controller connection
    TT_TIC.draw();

    // Air temperature sensor
    TT.draw();

    // Controller
    TIC.draw();

    // Air turbine
    glColor3f WHITE;
    turbine.draw();

    // Boiler_Wind pipe
    boiler_wind[0].draw();
    boiler_wind[1].draw();
    boiler_wind[2].draw();
    boiler_wind[3].draw();

    // Pressure Release Pipe
    boiler_.draw();

    // Pressure Valve;
    pressureValve.draw();

    // Boiler
    boiler.draw();

    // Pressure Indicator
    PrI.draw();

    // Oil Valve
    oilValve.draw();

    glPopMatrix();
    glutSwapBuffers();
}
示例#2
0
void planetsApp::draw() {
	gl::clear(Color(0, 0, 0)); 

	gl::enableDepthRead();
	gl::enableDepthWrite();
	gl::setMatrices(mCam.getCam());

	gl::color(Color(255,0,0));
	gl::drawSphere(Vec3f::zero(), 5);
	gl::color(Color(0,255,0));
	gl::drawSphere(mCam.getCam().getCenterOfInterestPoint(), 5);

	cont.draw();

	if (selected) {
		gl::color(Color(255,0,0));
		gl::drawStrokedCube(selected->_pos, Vec3f(2,2,2) * selected->_radius);
		
		gl::color(Color(0,255,255));
		gl::drawLine(point1, dir1);	
		gl::drawLine(point2, dir2);	
	}

	gl::popMatrices();
	gl::disableDepthRead();
	gl::disableDepthWrite();	
}
示例#3
0
void Scene::draw()
{
	// Background color
	this->setBackgroundColor(backColor);

	// No object to draw
	if (isEmpty()) return;

	// Anti aliasing 
	glEnable(GL_MULTISAMPLE);
	glEnable (GL_LINE_SMOOTH);
	glEnable (GL_BLEND);
	glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
	glHint (GL_LINE_SMOOTH_HINT, GL_DONT_CARE);

	
	// The main object
	drawObject(); 

	// Draw groups of relationship between segments
	drawGroups(); 

	// Draw the controllers if exist
	Controller * ctrl = ((Controller *)activeObject()->ptr["controller"]);
	if (ctrl) 
	{
		ctrl->draw(true, true);
		//sp->activeOffset->activeViewer->camera()->draw();
	}

	// Draw stacking with 3 objects
	if(isShowStacked) 
		drawStacking();

	// Suggestions
	sp->draw();

	// deformer
	if(activeDeformer) activeDeformer->draw();
	if(activeVoxelDeformer) activeVoxelDeformer->draw();

	// Draw debug geometries
	activeObject()->drawDebug();
}