Exemple #1
0
//--------------------------------------------------------------
void testApp::draw()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	glPushMatrix();
	glTranslatef((GLfloat)(ofGetWidth() / 2), (GLfloat)(ofGetHeight() / 2), 0.0f);
	gluLookAt(eyeX*100, eyeY*100, eyeZ*100, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);

	//glRotatef(cities[cities.size()-1].lat, 1.0f, 0.0f, 0.0f);		// Rotate On The X Axis
	//glRotatef(-cities[cities.size()-1].lng, 0.0f, 1.0f, 0.0f);		// Rotate On The Y Axis
	glRotatef(rotX, 1.0f, 0.0f, 0.0f);		// Rotate On The X Axis
	glRotatef(-rotY, 0.0f, 1.0f, 0.0f);		// Rotate On The Y Axis
	glRotatef(180.0f, 0.0f, 1.0f, 0.0f);		// Rotate On The X Axis
	
	//glRotatef(rotX, 1.0f, 0.0f, 0.0f);		// Rotate On The X Axis
	//glRotatef(rotY, 0.0f, 1.0f, 0.0f);		// Rotate On The Y Axis

	earth->draw();

	for (int j = 0; j < maxLongitude; ++j) {
		for (int i = 0; i < maxLatitude; ++i) {
			points[j * maxLatitude + i]->draw();
		}
	}

	for (int i = 0; i < cities.size(); ++i) {
		cities[i].draw();
	}

	if (showXYZ) drawXYZ();
	glPopMatrix();

	drawString();
	displayFPS();
}
Exemple #2
0
void ofxInkSim::draw()
{
    string whatdraw = "";
    if (drawMode == INKFIX)
    {
        whatdraw = "INKFIX";
        drawXYZ(fixInk.getOldTex()->getTextureReference(), 0, 0, width, height);
    }
    else if (drawMode == INKSURF)
    {
        whatdraw = "INKSURF";
        drawXYZ(surfInk.getOldTex()->getTextureReference(), 0, 0, width, height);
    }
    else if (drawMode == INKFLOW)
    {
        whatdraw = "INKFLOW";
        drawXYZ(flowInk.getOldTex()->getTextureReference(), 0, 0, width, height);
    }
    else if (drawMode == WATERFLOW)
    {
        whatdraw = "WATERFLOW";
        drawZ(velDen.getOldTex()->getTextureReference(), 0, 0, width, height);
    }
    
    if (bDebug)
    {
        int w = width/8;
        int h = height/8;
        
        drawXYZ(surfInk.getOldTex()->getTextureReference(), 0, 0, w, h);
        drawXYZ(misc.getOldTex()->getTextureReference(), w*1, 0, w, h);
        drawXYZ(velDen.getOldTex()->getTextureReference(), w*2, 0, w, h);
        drawXYZ(flowInk.getOldTex()->getTextureReference(), w*3, 0, w, h);
        drawXYZ(fixInk.getOldTex()->getTextureReference(), w*4, 0, w, h);
        drawXYZ(dist1.getOldTex()->getTextureReference(), w*5, 0, w, h);
        drawXYZ(dist2.getOldTex()->getTextureReference(), w*6, 0, w, h);
        drawXYZ(sinkInk.getOldTex()->getTextureReference(), w*7, 0, w, h);
        
        ofDrawBitmapStringHighlight("SurfInk OLD", 0, 15);
        ofDrawBitmapStringHighlight("Misc OLD", w*1, 15);
        ofDrawBitmapStringHighlight("VelDen OLD", w*2, 15);
        ofDrawBitmapStringHighlight("FlowInk OLD", w*3, 15);
        ofDrawBitmapStringHighlight("FixInk OLD", w*4, 15);
        ofDrawBitmapStringHighlight("Dist1 OLD", w*5, 15);
        ofDrawBitmapStringHighlight("Dist2 OLD", w*6, 15);
        ofDrawBitmapStringHighlight("SinkInk OLD", w*7, 15);
        
        depositionBuffer.draw(0, h, w, h);
        grain.draw(w*1, h, w, h);
        alum.draw(w*2, h, w, h);
        pinning.draw(w*3, h, w, h);
        drawXYZ(disorder.getTextureReference(), w*4, h, w, h);
        
        drawXYZ(surfInk.getNewTex()->getTextureReference(), 0, height - h, w, h);
        drawXYZ(misc.getNewTex()->getTextureReference(), w*1, height - h, w, h);
        drawXYZ(velDen.getNewTex()->getTextureReference(), w*2, height - h, w, h);
        drawXYZ(flowInk.getNewTex()->getTextureReference(), w*3, height - h, w, h);
        drawXYZ(fixInk.getNewTex()->getTextureReference(), w*4, height - h, w, h);
        drawXYZ(dist1.getNewTex()->getTextureReference(), w*5, height - h, w, h);
        drawXYZ(dist2.getNewTex()->getTextureReference(), w*6, height - h, w, h);
        drawXYZ(sinkInk.getNewTex()->getTextureReference(), w*7, height - h, w, h);
        
        ofDrawBitmapStringHighlight("SurfInk NEW", 0, height - h);
        ofDrawBitmapStringHighlight("Misc NEW", w*1, height - h);
        ofDrawBitmapStringHighlight("VelDen NEW", w*2, height - h);
        ofDrawBitmapStringHighlight("FlowInk NEW", w*3, height - h);
        ofDrawBitmapStringHighlight("FixInk NEW", w*4, height - h);
        ofDrawBitmapStringHighlight("Dist1 NEW", w*5, height - h);
        ofDrawBitmapStringHighlight("Dist2 NEW", w*6, height - h);
        ofDrawBitmapStringHighlight("SinkInk NEW", w*7, height - h);
        
        ofDrawBitmapStringHighlight(whatdraw, 0, height - h - 50);
        ofDrawBitmapStringHighlight("fps:" + ofToString(ofGetFrameRate()), 0, height - h - 30);
    }
}