• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ drawAxes函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: display

void display(void) {
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();

	drawText();
	glCallList(textList);

	if (displayFFT) {
		glPushMatrix();
		glCallList(fftList);
		glPopMatrix();
		glPointSize(pSize);
		glEnableClientState(GL_VERTEX_ARRAY);
		glEnableClientState(GL_COLOR_ARRAY);
		glVertexPointer(3, GL_DOUBLE, sizeof(point), fftPointList);
		glColorPointer(4, GL_FLOAT, sizeof(point), &fftPointList[0].r);
		glDrawArrays(GL_LINES, 0, fftN);
		glDisableClientState(GL_COLOR_ARRAY);
		glDisableClientState(GL_VERTEX_ARRAY);
	}

	if (displayHilbert) {
		drawHilbert();
	}

	glPushMatrix();
	glTranslatef(xx, yy, -zoom);
	glRotatef(rotx, 1.0, 0.0, 0.0);
	glRotatef(roty, 0.0, 1.0, 0.0);
	glRotatef(rotz, 0.0, 0.0, 1.0);

	GLfloat ambient1[] = {0.15f, 0.15f, 0.15f, 1.0f};
	GLfloat diffuse1[] = {0.8f, 0.8f, 0.8f, 1.0f};
	GLfloat specular1[] = {1.0f, 1.0f, 1.0f, 1.0f};
	GLfloat position1[] = {0.0f, 0.0f, 24.0f, 1.0f};
	glLightfv(GL_LIGHT1, GL_AMBIENT, ambient1);
	glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse1);
	glLightfv(GL_LIGHT1, GL_DIFFUSE, specular1);
	glLightfv(GL_LIGHT1, GL_POSITION, position1);
	glEnable(GL_LIGHT1);

	drawAxes();

	glPointSize(pSize);
	glEnableClientState(GL_VERTEX_ARRAY);
	glEnableClientState(GL_COLOR_ARRAY);
	glVertexPointer(3, GL_DOUBLE, sizeof(point), pointsList);
	glColorPointer(4, GL_FLOAT, sizeof(point), &pointsList[0].r);
	glDrawArrays(GL_POINTS, 0, sampleSize);
	glDisableClientState(GL_COLOR_ARRAY);
	glDisableClientState(GL_VERTEX_ARRAY);

	glPopMatrix();

	glutPostRedisplay();
	glutSwapBuffers();
}
开发者ID:archoad,项目名称:PRBG-3D,代码行数:58,代码来源:visualize3d.c


示例17: glPushMatrix

/*
 * Main display of the ColorSpaceKeyerOverlay class
 * @param args current arg (time/renderScale/pixelScale....
 * @return if there is something drawed by the function (y or n)
 */
bool ColorSpaceKeyerOverlay::draw( const OFX::DrawArgs& args )
{
	bool displaySomethings = false;
	if( _plugin->_paramBoolPointCloudDisplay->getValue() ) //Is CloudPointData displayed ? (GUI)
	{
		glPushMatrix();								//new transformation
		prepareOpenGLScene(args);					//prepare frustum and projection settings
		if(_plugin->_updateVBO )					//VBO need to be updated
		{
			//update VBO
			getData().updateVBO();					//update VBO from VBO data (already computed)
			_plugin->_updateVBO = false;			//VBO has been recomputed
		}
		if(_plugin->_resetViewParameters)			//View parameters need to be reseted
		{
			_rotateX = _rotateY = 0;				//reset parameters
			_rotateXForm = _rotateYForm = 0;		//reset geodesic form center rotation parameters
			_plugin->_resetViewParameters = false;	//view parameters has been changed
			setToIdentity(_modelViewMatrix);		//reset model-view matrix to identity
		}
		//OpenGL parameters
		glEnable(GL_DEPTH_TEST);					//active depth (better for understand results)
		
		//drawing Axes
		drawAxes();									//draw the X, Y and Z axes
		//drawing VBO
		if(getData()._isVBOBuilt)					//if VBO has already been built
			getData()._imgVBO.draw();				//draw VBO
		
		//drawing color selection VBO
		if(getData()._isSelectionVBOBuilt && _plugin->_paramBoolSeeSelection->getValue())	//color selection VBO data is built
		{
			glColor3f(1.0f,1.0f,1.0f);														//color is white
			getData()._selectionColorVBO.draw();											//draw selection VBO
		}
		//drawing spill selection VBO
		if(getData()._isSpillSelectionVBOBuilt && _plugin->_paramBoolSeeSpillSelection->getValue()) //spill selection VBO data is built
		{
			glColor3f(.3f,.3f,.3f);														//color is white
			getData()._selectionSpillVBO.draw();										//draw selection VBO
		}
		
		//drawing average
		getData()._averageColor.draw();								//draw average (cross)
		//drawing geodesic form
		if(_plugin->_paramBoolDisplayGeodesicForm->getValue())		//does user want to display color geodesic form
			getData()._geodesicFormColor.draw(false);				//draw geodesic form on screen without alpha
		if(_plugin->_paramBoolDisplaySpillGF->getValue())			//does user want to display spill geodesic form
			getData()._geodesicFormSpill.draw(true);				//draw spill geodesic form on screen with alpha
		
		//OpenGL end of parameters
		glDisable(GL_DEPTH_TEST);	//disable deep
		glPopMatrix();				//pop matrix
		displaySomethings = true;	//something has been drown on screen
	}
	return displaySomethings;		//return if overlay has displayed something (y or n)
}
开发者ID:Achammem,项目名称:TuttleOFX,代码行数:62,代码来源:ColorSpaceKeyerOverlay.cpp


示例18: drawScene

void drawScene(void)
{
  drawAxes();
  drawParameters();
  drawLight();
  currentTexture = textures[TEX_CRATE];
  cube(0,0,0, 2,2,2, cubeRotation);
  currentTexture = textures[TEX_DEFAULT];
}
开发者ID:davidwparker,项目名称:opengl-screencasts-2,代码行数:9,代码来源:draw.c


示例19: draw

void draw() {
		
	
	glPushMatrix();
	glRotated(angle, 1.0, 1.0, 1.0);
	drawScene();
	glPopMatrix();
	
	drawAxes();
}
开发者ID:dknife,项目名称:201502_Graphics,代码行数:10,代码来源:drawScene.cpp


示例20: displayAxes

/* display axes in a matrix */
void displayAxes(void)
{
	glPushMatrix();
	glTranslatef(translateAxes.posX, translateAxes.posY, translateAxes.posZ); 
	glRotatef(rotateAxes.rotX, THIS, NOT_THIS, NOT_THIS);
	glRotatef(rotateAxes.rotY, NOT_THIS, THIS, NOT_THIS);
	glRotatef(rotateAxes.rotZ, NOT_THIS, NOT_THIS, THIS);
	drawAxes();
	glPopMatrix();
}
开发者ID:dibayendu,项目名称:ships_war,代码行数:11,代码来源:axes.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ drawAxis函数代码示例发布时间:2022-05-30
下一篇:
C++ drand48函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap