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

C++ drawObject函数代码示例

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

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



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

示例1: recalcModelView

void Scene::draw() {
    GLfloat m[4][4];
    recalcModelView();
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    if (showAxis) {
        drawRotationAxis();
    }
    
    if (modelsMode) {        
        glScalef(6, 6, 6);        
        for (unsigned i=0; i < models.size(); i++) {
            models[i]->render();
        }
    } else {
        if (game) {
            drawObject(vertexes, exluded);
            drawExcluded();
        } else {
            drawObject(vertexes, -1);
        }

        if (skeleton) {
            drawSkeleton();
        }
    }
      
    glutSwapBuffers();
}
开发者ID:aurelijusb,项目名称:CG-models,代码行数:28,代码来源:Scene.cpp


示例2: drawObject

void Scene::draw(sf::RenderTarget &target, sf::RenderStates states) const {
	if (player) {
		drawObject(*player, target, states);
	}
	
	for(const auto &object : m_objects) drawObject(object, target, states);
}
开发者ID:Quent42340,项目名称:libegdt,代码行数:7,代码来源:Scene.cpp


示例3: renderGame

void renderGame() {
    drawBackground(bgX, bgY, bgClip);

    drawObject(&player, player.clip);

    if(someObject != NULL) {
        drawObject(someObject, someObject->clip);
    }
    writeText(0, 0, "r37r0 v0.0");
    if(msgTime>0) writeText((SCREENW>>1)-(TILEW*SDL_strlen(message)>>1), SCREENH-TILEH, message);
}
开发者ID:suspirii,项目名称:C0NS0LEC0WB0Y,代码行数:11,代码来源:game.c


示例4: rotateRow

void rotateRow( int x, int y, int z, int v, int s)
{
    // rotate all objects matching x, y, z mask  with value v
    // s verse of rotation
    int j, i, ix, iy, iz;
    
    // animation loop 0-90 deg
    for(j = 0; j <= 90; j+= STEP)
    {
        // clear painting scren
        gClearScreen();                 // clear the hidden screen

        // search all objects for matching pattern
        for( iz=0; iz<3; iz++)
            for( iy=0; iy<3; iy++)
                for(ix=0; ix<3; ix++)
                {   
                    if ( ix*iy*iz == 1) continue; // ignore c[1][1][1]
                    i = c[ix][iy][iz];

                    // check if requires rotation
                    if (( (ix+1)*x == v+1) || ((iy+1)*y == v+1) || ((iz+1)*z == v+1))
                    {  // rotate the corresponding axis
                        // transform and draw the object                        
                        initMatrix( mo, x*s*j, y*s*j, z*s*j, 0, 0, 0);
                        drawObject( mo, i);

                        // if final rotation
                        if ( j == 90)
                            rotateObject( mo, i);
                    }
                    else 
                    {
                        // transform and draw the object                        
                        initMatrix( mo, 0, 0, 0, 0, 0, 0);
                        drawObject( mo, i);
                    }    
                    
                }
        
        
        // update visible screen
        copyV();            
    } // for j steps

    // update pointer matrix c[][][]
    rotateC( x, y, z, v, s);    
        
} // animate rotation of one row/face   
开发者ID:WilliamAvila,项目名称:PIC32MX460F512L_Examples,代码行数:49,代码来源:Cubes.c


示例5: display

void display (void) {
	glClearDepth (1);
    glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glLoadIdentity();  
	gluLookAt(120.0, 20.0, 140.0,		
              0.0, 0.0, 0.0,		
              0.0, 5.0, 0.0);		
	float pos[]={10.0,90.0,-110.0,1.0};        //set the position
	glLightfv(GL_LIGHT0,GL_POSITION,pos);
	glEnable(GL_COLOR_MATERIAL);
	
	camera();
	glPushMatrix();
	
	glTranslatef(0, -30, 0);
	//glScalef(10,10,10);
	//glCallList(cube);
	glPopMatrix();
	drawGrid();
	//createHabitat();
	drawWalls();
	drawHabitat();
	drawFood();
	drawObject();
	drawPredator();

	//saveToDisk();
    glutSwapBuffers();
}
开发者ID:avasay,项目名称:Flocking,代码行数:29,代码来源:flock1.cpp


示例6: perspectiveMatrixX

void App::drawFrame()
{
  mat4 projection = perspectiveMatrixX(1.5f, width, height, 0.001f, 1.0f);
  mat4 mvRotate = rotateXY(-wx, -wy);
  mat4 modelview = mvRotate * translate(-camPos);

  glMatrixMode(GL_PROJECTION);
  glLoadTransposeMatrixf(projection);

  glMatrixMode(GL_MODELVIEW);
  glLoadTransposeMatrixf(modelview);

  // Determine the shader selections
  radialSelect = 0;
  if(doRadialEnvMap->isChecked())
  {
    radialSelect = 1;
  }
  constMipSelect = 0;
  if(constantMipLevel->isChecked())
  {
    constMipSelect = 1;
  }

  // Clear only depth
  renderer->clear(false, true, false);

  // Draw the background environment
  drawEnvironment(projection * mvRotate);

  // Draw the object
  drawObject();
}
开发者ID:dtrebilco,项目名称:RadialEnvMap,代码行数:33,代码来源:App.cpp


示例7: DrawFlashlight

void DrawFlashlight() {
	glActiveTexture(GL_TEXTURE0);
	glBindTexture(GL_TEXTURE_2D, tex2);
	glm::vec3 dir = m_center - m_eye;
	matM = glm::translate(glm::mat4(1.0f), m_eye+dir);

	glm::vec4 temp;
	temp = glm::rotate(glm::mat4(1.0f), angleLR, m_up) * glm::vec4 (m_eye+dir,0);// *glm::vec4(m_center - m_eye, 0);

	glm::vec4 temp2;

	glm::vec3 look = glm::normalize(m_center - m_eye);
	glm::vec3 vert_rot = glm::cross(m_up, look);

	temp2 = glm::rotate(glm::mat4(1.0f), rely*mouse_speed, vert_rot)*glm::vec4(m_center - m_eye, 0);

	m_center = m_eye + glm::vec3(temp2);

	angleUD += rely*mouse_speed;
	if (angleUD > 360)angleUD -= 360;
	if (angleUD < -360)angleUD += 360;

	//matM = glm::scale(matM, glm::vec3(1.0, 1.0, 1.0));
		drawObject();
}
开发者ID:kkapitan,项目名称:Maze,代码行数:25,代码来源:main_file.cpp


示例8: drawTile

void cScene::render() {
	// Draw model
	if (data->front == 1) {
		for (int i = 0; i < (int)map.size(); i++) {
			int k = (int)map.size() - 1 - i;
			for (int j = 0; j <= i; j++) {
				drawTile(j, k);
				if (objmap[j][k] != 0) drawObject(j, k);
				k++;
			}
		}

		for (int i = 1; i < (int)map.size(); i++) {
			int k = 0;
			for (int j = i; j < (int)map.size(); j++) {
				drawTile(j, k);
				if (objmap[j][k] != 0) drawObject(j, k);
				k++;
			}
		}
	} else {
		for (int i = 0; i < (int)map.size(); i++) {
			int j = (int)map.size() - 1;
			for (int k = i; k >= 0; k--) {
				drawTile(j, k);
				if (objmap[j][k] != 0) drawObject(j, k);
				j--;
			}
		}

		for (int i = 1; i < (int)map.size(); i++) {
			int k = (int)map.size() - 1;
			for (int j = (int)map.size() - 1 - i; j >= 0; j--) {
				drawTile(j, k);
				if (objmap[j][k] != 0) drawObject(j, k);
				k--;
			}
		}
	}

	if (DEBUG_MODE) {
		drawHighlightTile((int)playerx,-(int)playerz);
		drawHighlightTile((int)playerx +1,-(int)playerz);
		drawHighlightTile((int)playerx,-(int)playerz +1);
		drawHighlightTile((int)playerx +1,-(int)playerz +1);
	}
}
开发者ID:addja,项目名称:keep-running-n-nobody-gets-hurt,代码行数:47,代码来源:cScene.cpp


示例9: SDL_RenderClear

void Renderer::drawBackground(const std::string& name)
{
	SDL_RenderClear(sRenderer);
	loadTexture(name);

	const ObjRenderable background {name, 0, 0, 0, 0, SCREEN_HEIGHT, SCREEN_WIDTH};
	drawObject(background);
}
开发者ID:Ffaithy,项目名称:Simple-Pattern-Matching-Game,代码行数:8,代码来源:Renderer.cpp


示例10: drawIronman

void drawIronman() {
	glColor3f(0.7, 0.7, 0.3);
	glPushMatrix();
	glTranslatef(0.0, 0.0, 0.0);
	glScalef(1.0, 1.0, 1.0);
	drawObject(&ironman);
	glPopMatrix();
}
开发者ID:kidsnow,项目名称:GLUT,代码行数:8,代码来源:display.cpp


示例11: display

//-------------------------------------------------------------------------
//  This function is passed to glutDisplayFunc in order to display 
//	OpenGL contents on the window.
//-------------------------------------------------------------------------
void display (void)
{
	glClear (GL_COLOR_BUFFER_BIT);

    drawObject();
    drawFPS();
	
	glutSwapBuffers ();
}
开发者ID:AM1244,项目名称:Blog,代码行数:13,代码来源:FPS.cpp


示例12: ZBuffer

void Rasterization::drawScene(SceneRenderer * sceneRenderer, Zone & renderingZone) {
	CameraScreen * cameraScreen = sceneRenderer->getCameraScreen();
	Screen * screen = cameraScreen->getScreen();
	this->zbuffer = new ZBuffer(screen->getWidth(), screen->getHeight());
	std::vector<Object3D *> objects = sceneRenderer->getScene()->getObjects3D();
	for(std::vector<Object3D *>::iterator it = objects.begin(); it != objects.end(); it++) {
		drawObject(sceneRenderer->getObject3DRenderer(*it), renderingZone);
	}
	delete zbuffer;
}
开发者ID:Tug,项目名称:RayTracer,代码行数:10,代码来源:Rasterization.cpp


示例13: painter

void ImageWidget::paintEvent(QPaintEvent *event) {
  QWidget::paintEvent(event);

  QPainter painter(this);
  painter.drawImage(QPoint(0, 0), image);

  foreach (const QRect &object, curObjects) {
    drawObject(painter,
               (zoomSet ? Util::scaleRect(object, zoomFactor) : object));
  }
开发者ID:netromdk,项目名称:possamp,代码行数:10,代码来源:ImageWidget.cpp


示例14: Render

void Render()
{
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glColor3d(7,7,7);
  
  drawObject(Object_1);
  
  glutSwapBuffers(); 
  glutPostRedisplay();
}
开发者ID:fear-sfx,项目名称:C-turtle,代码行数:10,代码来源:Rotation.c


示例15: glPushMatrix

void CCubeZoom::renderChild(int nDepth)
{
	if (nDepth > 3)
		return;

	if (	(m_vCubes[nDepth].m_fScale >= fCUBE_RING_START) && 
			(nDepth < nMAX_CUBE_DEPTH - 1) )
	{
		glPushMatrix();

			renderChild(nDepth + 1);

			glNewList(m_glDispStartIndex + nDepth, GL_COMPILE);

				// Render the center object
				drawObject(nDepth);

				// Render the orbiting objects
				for (int nChild = 0; nChild < nCUBE_CHILDREN; nChild++)
				{
					glPushMatrix();
						glRotatef(fROTATE_ANGLE * nChild, 0.0f, 1.0f, 0.0f);
						glTranslatef(0.0f, 0.0f, -4.5f);
						glCallList(m_glDispStartIndex + nDepth + 1);
					glPopMatrix();
				}
			glEndList();	

		glPopMatrix();

	} else {	
	
		glNewList(m_glDispStartIndex + nDepth, GL_COMPILE);
			drawObject(nDepth);	
		glEndList();

#ifdef _DEBUG
		m_nDepth = nDepth;
#endif // _DEBUG
	}

	glColor3f(1.0f, 1.0f, 1.0f);
}
开发者ID:tronster,项目名称:node,代码行数:43,代码来源:CCubeZoom.cpp


示例16: glCallList

void Model::drawModel(void)
{
    if(!objectLoaded)
        return;

    if(displayList != 0)
    {
        glCallList(displayList);
        return;
    }

    displayList = glGenLists(1);

    glNewList(displayList, GL_COMPILE);
    drawObject(false);
    drawObject(true);

    glEndList();
}
开发者ID:mikestaub,项目名称:interactiveKnightsTour,代码行数:19,代码来源:model.cpp


示例17: drawPlayfield

    /*--------------------------------------------------------------------------------
        Function    : Display::drawLevelItems
        Description : Draws the Items found in the given level.  This function is
                      called after the Level's map has been drawn in the 
                      drawPlayfield() function.
        Inputs      : Level object
        Outputs     : None
        Return      : void
    --------------------------------------------------------------------------------*/
    void Display::drawLevelItems(const LevelPtr level)
    {
        vector<ItemPtr> items = level->getItems();
        vector<ItemPtr>::const_iterator it, end;
        it = items.begin(); end = items.end();

        for(; it!=end; ++it)
        {
            drawObject(*it);
        }
    }
开发者ID:jcarvajal288,项目名称:RLEngine,代码行数:20,代码来源:Display.cpp


示例18: drawCurrent

/*------------------------------------------------------------*/
void drawCurrent( void )
{
#if defined(SHOW_TEXT_STEPS)
    printf( "Drawing the current item.\n");
#endif
    // Draw a point so that the user may edit the object.
    drawObject( current );

    drawPoint( current->x0, current->y0 );
    drawPoint( current->x1, current->y1 );
}
开发者ID:jasonfsmitty,项目名称:psu_projects,代码行数:12,代码来源:p1.cpp


示例19: trackFilteredObject

void trackFilteredObject(Object theObject,Mat threshold,Mat HSV, Mat &cameraFeed)
{

    vector <Object> objects;
    Mat temp;
    threshold.copyTo(temp);
    //these two vectors needed for output of findContours
    vector< vector<Point> > contours;
    vector<Vec4i> hierarchy;
    //find contours of filtered image using openCV findContours function
    findContours(temp,contours,hierarchy,CV_RETR_CCOMP,CV_CHAIN_APPROX_SIMPLE );
    //use moments method to find our filtered object
    bool objectFound = false;
    if (hierarchy.size() > 0)
    {
        int numObjects = hierarchy.size();
        //if number of objects greater than MAX_NUM_OBJECTS we have a noisy filter
        if(numObjects<MAX_NUM_OBJECTS){
            for (int index = 0; index >= 0; index = hierarchy[index][0])
            {
                Moments moment = moments((cv::Mat)contours[index]);
                double area = moment.m00;

                //if the area is less than 20 px by 20px then it is probably just noise
                //if the area is the same as the 3/2 of the image size, probably just a bad filter
                //we only want the object with the largest area so we safe a reference area each
                //iteration and compare it to the area in the next iteration.
                if(area>MIN_OBJECT_AREA)
                {
                    Object object;

                    object.setXPos(moment.m10/area);
                    object.setYPos(moment.m01/area);
                    object.setType(theObject.getType());
                    object.setColor(theObject.getColor());

                    objects.push_back(object);

                    objectFound = true;

                }else objectFound = false;
            }
            //let user know you found an object
            if(objectFound ==true)
            {
                //draw object location on screen
                drawObject(objects,cameraFeed,temp,contours,hierarchy);
            }

        }
        else
            putText(cameraFeed,"TOO MUCH NOISE! ADJUST FILTER",Point(0,50),1,2,Scalar(0,0,255),2);
    }
}
开发者ID:DreamtaleCore,项目名称:AndroidProfiles,代码行数:54,代码来源:multipleObjectTracking+(copy).cpp


示例20: drawEnemySet

void drawEnemySet(LEVEL level) {
  unsigned int i = 0;

  for (i = 0; i < level.enemyNumber; i++) {
    if ((level.enemyset+i)->visible) {
      drawObject(level.enemyset+i);
    } else if ((level.enemyset+i)->explosion_delay) {
      drawExplosion(level.enemyset+i);
    }
  }
}
开发者ID:chemscobra,项目名称:usb-space-invaders,代码行数:11,代码来源:renderer.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ drawPixel函数代码示例发布时间:2022-05-30
下一篇:
C++ drawMap函数代码示例发布时间: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