当前位置: 首页>>代码示例>>C++>>正文


C++ drawAxes函数代码示例

本文整理汇总了C++中drawAxes函数的典型用法代码示例。如果您正苦于以下问题:C++ drawAxes函数的具体用法?C++ drawAxes怎么用?C++ drawAxes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了drawAxes函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: drawGrid

void FunctionGraphView::drawRect(KDContext * ctx, KDRect rect) const {
  ctx->fillRect(rect, KDColorWhite);
  drawGrid(ctx, rect);
  drawAxes(ctx, rect, Axis::Horizontal);
  drawAxes(ctx, rect, Axis::Vertical);
  drawLabels(ctx, rect, Axis::Horizontal, true);
  drawLabels(ctx, rect, Axis::Vertical, true);
}
开发者ID:Tilka,项目名称:epsilon,代码行数:8,代码来源:function_graph_view.cpp

示例2: glClearColor

void GLCanvas::display(void)
{
	// Clear the display buffer
	Vec3f bgColor = scene->getBackgroundColor();
	glClearColor(bgColor.x(), bgColor.y(), bgColor.z(), 1.0);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	// Set the camera parameters
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	scene->getCamera()->glPlaceCamera();

	glEnable(GL_DEPTH_TEST);
	drawAxes();  // Remove this line to disable axis display
	glEnable(GL_LIGHTING);

	// Place each of the lights in the scene
	for (int i = 0; i<scene->getNumLights(); i++) {
		scene->getLight(i)->glInit(i);
	}

	// Draw the scene tree
	scene->getGroup()->paint();

	// Swap the back buffer with the front buffer to display
	// the scene
	glutSwapBuffers();
}
开发者ID:netwarm007,项目名称:mit-ocw-6.837,代码行数:28,代码来源:glcanvas.cpp

示例3: drawAxes

void SmokeSim::draw(const Camera& c) {
  drawAxes(); 
  mGrid.draw(c);
  if (mRecordEnabled) {
    grabScreen();
  }
}
开发者ID:brindza,项目名称:phys-anim,代码行数:7,代码来源:smoke_sim.cpp

示例4: myDisplay

void myDisplay() {
	glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);

	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	gluLookAt(0.0, 0.5, 1.5, 0, 0, 0, 0, 1, 0);
	LightPosition();

	glDisable(GL_LIGHTING);
	glLineWidth(5);
	drawAxes();

	glEnable(GL_LIGHTING);


	//glDisable(GL_DEPTH_TEST); 
	static float angle = 0.0;
	glRotatef(angle, 0.0, 1.0, 0.0);
	angle += 0.5;
	glPushMatrix();
	glTranslatef(0, 0, -0.5);
	glColor4f(1, 1, 1, 0.5);
	glutSolidTeapot(0.5);
	glPopMatrix();

	
	glPushMatrix();	
	glColor4f(0, 0, 1, 0.5);
	glutSolidTeapot(0.5);
	glPopMatrix();
	//glEnable(GL_DEPTH_TEST);

	glutSwapBuffers();
}
开发者ID:dknife,项目名称:201502_Graphics,代码行数:34,代码来源:main.cpp

示例5: getOkcVisualMapResult

void OkcViewDisplay::paint() {
    OkcVisualMapResult* vmr = getOkcVisualMapResult();

	// If the VisualMapResult is NULL, do nothing
	if (!vmr) {
		return;
	}

    // Set parameters about data size, dimension size and dimension attributes
	setParameters();

	// If the dataset does not have enough dimensions, do nothing
	if (!testDimensionality()) return;

	Data* data = vmr->getData();
	assert ( typeid(*data)==typeid(OkcData));
	// if the brush is not null, draw it
	Brush* curBrush = vmr->getBrush();
	if (curBrush) {
		drawSingleBrush(curBrush);
	}

	drawData();

	drawAxes();

}
开发者ID:63n,项目名称:XmdvTool,代码行数:27,代码来源:OkcViewDisplay.cpp

示例6: setForeground

//
// Process the Expose event: draw in the window
//
void MyWindow::onExpose(XEvent& event) {
    // Erase a window
    setForeground(getBackground());
    fillRectangle(m_RWinRect);

    // Draw the coordinate axes
    drawAxes("black", true, "gray");

    // Draw a graph of function
    setForeground("red");
    drawGraphic();

    // Draw a cross on mouse click
    if (clicked) {
        if (mouseButton == Button1)
            setForeground("blue");      // Left button
        else if (mouseButton == Button2)
            setForeground("SeaGreen");  // Middle button
        else if (mouseButton == Button3)
            setForeground("brown");     // Right mouse button
        R2Vector dx(0.2, 0.);
        R2Vector dy(0., 0.2);
        drawLine(lastClick-dx, lastClick+dx);
        drawLine(lastClick-dy, lastClick+dy);
    }
}
开发者ID:tokar1,项目名称:mech-math,代码行数:29,代码来源:func.cpp

示例7: glClear

void CMeshViewer::draw() const
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	gluLookAt(m_camera.x, m_camera.y, m_camera.z
		, m_camera.lookAt.x, m_camera.lookAt.y, m_camera.lookAt.z
		, 0, 1, 0);
	m_sceneObject.draw();
	// remember lighting state and disable lighting
	bool isLightingEnabled = glIsEnabled(GL_LIGHTING);
	bool isTextureEnabled = glIsEnabled(GL_TEXTURE_2D);
	if (isLightingEnabled)
		glDisable(GL_LIGHTING);
	if (isTextureEnabled)
		glDisable(GL_TEXTURE_2D);
	// unlit elements
	glTranslatef(m_worldTranslationX, m_worldTranslationY, 0);
	drawAxes();
	//	restore previous lighting state
	if (isLightingEnabled)
		glEnable(GL_LIGHTING);
	if (isTextureEnabled)
		glEnable(GL_TEXTURE_2D);
}
开发者ID:baiyu0708,项目名称:Founder.ObjParser,代码行数:25,代码来源:MeshViewer.cpp

示例8: ofVec3f

//--------------------------------------------------------------
void testApp::draw(){
    centroid = center;
    cam.setPosition(ofVec3f(0, 0, -centroid.z));
    
    cam.lookAt(centroid, ofVec3f(0,1,0));
    cam.setFarClip(50000);
    
    cam.begin();
    
    ofPushMatrix();
    ofTranslate(camPosX, camPosY, camZoom);
    
    if(bTop){
        pivot(centroid, 100, 0, 0);
    }
    else{
        pivot(centroid, camRotX, camRotY, 0);
    }
    
    ofScale(-1.0, 1.0, 1.0);
    drawAxes(centroid, refPoint);
    
    ofPushStyle();
    
    //-------------------------
    for(int i = 0; i < K; i++)
        kinects[i].draw();
    
    
    if(bCalibrated && bTracking){
        for(int i = 0; i < N; i++)
            trackers[i].draw();
        
        for(int i = 0; i < N - 1; i++)
            for(int j = 1; j < N; j++){
                setLineColor(i + j);
                ofLine(trackers[i].lerpedPos, trackers[j].lerpedPos);
            }
        
        //-------------------------
        ofEnableAlphaBlending();
        ofSetColor(255, 0, 0, 50);
        ofFill();
        ofBeginShape();
        for(int i = 0; i < N; i++)
            ofVertex(trackers[i].lerpedPos);
        ofEndShape();
        ofDisableAlphaBlending();
        //-------------------------
    }
    
    ofPopStyle();
   

    ofPopMatrix();

    cam.end();
    
    gui.draw();    
}
开发者ID:SopiMlab,项目名称:kinectTrackerRealTime,代码行数:61,代码来源:testApp.cpp

示例9: glClear

void VCanvas::paintGL()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();

	glTranslatef(0.0, 0.0, -10.0);

	qglColor(Qt::darkBlue);

	glBegin(GL_POINTS);
	glVertex3f(0.0, 0.0, 0.0);
	glEnd();

	glScalef(scaling, scaling, scaling);

	glRotatef(rotationX, 1.0, 0.0, 0.0);
	glRotatef(rotationY, 0.0, 1.0, 0.0);
	glRotatef(rotationZ, 0.0, 0.0, 1.0);

	glTranslatef(translX, translY, translZ); //

	//drawAxes(axesLength);
	if (drawingData != 0)
		drawData();
	if (areAxesVisible)
		drawAxes(axesLength);
}
开发者ID:GhostVIRUS,项目名称:VV3D,代码行数:29,代码来源:VCanvas.cpp

示例10: display

void display() {
	
	// 카메라 위치
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	gluLookAt(
			  0, 0, 5, 
			  0, 0, 0, 
			  0, 1, 0);
	
	
	glClear(GL_COLOR_BUFFER_BIT);
	
	drawAxes();
	glColor3f(1, 1, 0);
	draw();
	glTranslatef(1.0, 0.0, 0.0);
	glColor3f(0, 1, 1);	
	draw();
	glTranslatef(-0.5, 1.0, 0.0);
	glColor3f(1, 0, 0);
	draw();
	
	
	// 화면 송출
	glutSwapBuffers();
}
开发者ID:dknife,项目名称:201502_Graphics,代码行数:27,代码来源:main.cpp

示例11: draw3D

void draw3D() {
    glLoadIdentity();                               // Load a new matrix

    camera();                                       // Calculate and set cameraview and cameraposition
    
    incAnimationVars();                                         

    // Draw Ship
    glPushMatrix();
        glTranslatef(0.0f, 0.0f,  -2.0f);
        drawShip();
    glPopMatrix();
    glPushMatrix();
        glRotatef(angle, 0, 1, 0);
        glTranslatef(0.0f, 0.0f,  -10.0f);
        drawShip();
    glPopMatrix();
    glPushMatrix();
        glTranslatef(0.0f, 0.0f, dist);
        glRotatef(90, 0, 1, 0);
        drawShip();
    glPopMatrix();
    
    drawAxes();
    
    // Draw grid
    ////////////////////
    glPushMatrix();                                 // Save matrix
    glTranslatef( 0.0f, -0.2f, 0.0f);               // Translate grid in the y-axis
    drawGrid();                                     // Draw a grid on the ground
    glPopMatrix();                                  // Restore matrix
}
开发者ID:te-bachi,项目名称:cgr,代码行数:32,代码来源:draw.c

示例12: resetPaintRect

void WeatherChart::paintEvent(QPaintEvent *)
{
    resetPaintRect();

    QPainter p;
    p.begin(this);

    if (scaleRect.width() == 0 && scaleRect.height() == 0)
    {
        setMinMax();
        resetZoom();
    }

    p.setBrush(QColor(20,20,20));
    p.setPen(QColor(20,20,20));
    p.drawRect(0, 0, width(), height());

    drawAxes(&p);
    drawChart(&p);

    if (scaling)
        drawScaleRect(&p);

    p.end();
}
开发者ID:primijos,项目名称:f1lt,代码行数:25,代码来源:weatherchart.cpp

示例13: glClear

void GLWidget::paintGL()
{
    //delete color and depth buffer
    glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();

    glTranslatef(position.x(), position.y(), position.z());
    glRotatef(xRot / 16.0, 1.0, 0.0, 0.0);
    glRotatef(yRot / 16.0, 0.0, 1.0, 0.0);
    glRotatef(zRot / 16.0, 0.0, 0.0, 1.0);
    //applyCamera();

    drawAxes();
    drawGrid();

    timerQuery.begin();
    // draw meshes
    for(int i=0; i<meshes.size(); i++) {
        meshes.at(i).draw();
    }
    timerQuery.end();

    qDebug() << timerQuery.waitForResult() / 1000000.0;
}
开发者ID:sebastianhaas,项目名称:frrviewer,代码行数:26,代码来源:glwidget.cpp

示例14: drawMagnitudes

void AnalysisView::runAnalysis() {

	drawMagnitudes();
	drawSubbands();
	drawAxes();
	drawClipping();
}
开发者ID:unjust,项目名称:noesys,代码行数:7,代码来源:analysis_view.cpp

示例15: myDisplay

void myDisplay() {
	glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);

	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	gluLookAt(0, 30, 40, 0, 30, 0, 0, 1, 0);

	LightPosition();

	glDisable(GL_LIGHTING);
	glLineWidth(5);
	drawAxes();

	static float angle = 0.0;
	glRotatef(angle, 0, 1, 0);
	angle += 0.5;
	glLineWidth(1);
	myMesh.drawMesh();
	clothMesh.drawMesh();

	glEnable(GL_LIGHTING);


	glutSwapBuffers();
}
开发者ID:dknife,项目名称:201502_Graphics,代码行数:25,代码来源:main.cpp


注:本文中的drawAxes函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。