本文整理汇总了C++中drawBox函数的典型用法代码示例。如果您正苦于以下问题:C++ drawBox函数的具体用法?C++ drawBox怎么用?C++ drawBox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drawBox函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: drawBox
void GPUOctree::drawBoxNode(const XYZ& center, float size, int x, int y) const
{
drawBox(center, size);
int pools = x * 2;
int poolt = y * 2;
float halfSize = size/2;
XYZ halfCenter;
for (int k=0;k<2;k++) {
for (int j=0;j<2;j++) {
for (int i=0;i<2;i++) {
unsigned long poolloc = (poolt + j)*INDIRECTIONPOOLWIDTH + pools + i;
if(i==0) halfCenter.x = center.x - halfSize;
else halfCenter.x = center.x + halfSize;
if(j==0) halfCenter.y = center.y - halfSize;
else halfCenter.y = center.y + halfSize;
if(k==0) halfCenter.z = center.z - halfSize;
else halfCenter.z = center.z + halfSize;
if(k==0) {
x = m_idr[poolloc*4];
y = m_idr[poolloc*4+1];
if(x >=0) drawBoxNode(halfCenter, halfSize, x, y);
}
else {
x = m_idr[poolloc*4+2];
y = m_idr[poolloc*4+3];
if(x >=0) drawBoxNode(halfCenter, halfSize, x, y);
}
}
}
}
}
开发者ID:esotericDisciple,项目名称:makoto,代码行数:40,代码来源:GPUOctree.cpp
示例2: DebugPrintf
void ScummDebugger::printBox(int box) {
if (box < 0 || box >= _vm->getNumBoxes()) {
DebugPrintf("%d is not a valid box!\n", box);
return;
}
BoxCoords coords;
int flags = _vm->getBoxFlags(box);
int mask = _vm->getMaskFromBox(box);
int scale = _vm->getBoxScale(box);
_vm->getBoxCoordinates(box, &coords);
// Print out coords, flags, zbuffer mask
DebugPrintf("%d: [%d x %d] [%d x %d] [%d x %d] [%d x %d], flags=0x%02x, mask=%d, scale=%d\n",
box,
coords.ul.x, coords.ul.y, coords.ll.x, coords.ll.y,
coords.ur.x, coords.ur.y, coords.lr.x, coords.lr.y,
flags, mask, scale);
// Draw the box
drawBox(box);
}
开发者ID:iPodLinux-Community,项目名称:iScummVM,代码行数:22,代码来源:debugger.cpp
示例3: switch
void QGLE::drawOSnap(QPainter *p, QPair<QPointF, int> snap)
{
p->setPen(osnapPen());
// Switch on snap.second
switch(snap.second)
{
case PerpendicularSnap:
drawPerpMark(p,snap.first,osnapPen());
break;
case TangentSnap:
drawTangentMark(p,snap.first,osnapPen());
break;
case IntersectSnap:
drawIntersectMark(p, snap.first, osnapPen());
break;
default:
drawBox(p,snap.first,OSNAP_BOX_SIZE,osnapPen());
}
}
开发者ID:pnkfelix,项目名称:glx-gle,代码行数:22,代码来源:qgle_statics.cpp
示例4: glColor3d
unsigned int nRenderer::drawNode(nRTreeNode *node, unsigned int lev){
if(node->isNull() || (node->isLeaf() && node->getChildren().size() == 1)) {
return 0;
}
unsigned int nodes = 1;
unsigned int mod = lev % 7 + 1;
glColor3d((mod & 0b001) ? 1 : 0, (mod & 0b010) ? 1 : 0, (mod & 0b100) ? 1 : 0);
DrawMode m = getDrawMode();
setDrawMode(WireFrame);
setAttribute(BackFaceCulling, false);
drawBox(nBoundingBox::create(node->getNegative(), node->getPositive()));
if(!node->isLeaf()) {
list<nRTreeNode *> lst = node->getSubNodes();
for(list<nRTreeNode *>::iterator it = lst.begin(); it != lst.end(); it++) {
nodes += drawNode(*it, lev + 1);
}
}
setAttribute(BackFaceCulling, true);
setDrawMode(m);
nMaterial::release();
return nodes;
}
开发者ID:gan74,项目名称:nGine,代码行数:22,代码来源:nRenderer.cpp
示例5: drawCursor
void drawCursor()
{
Entity *e;
if (cursor.type == TILES)
{
drawImage(tileImage(cursor.tileID), cursor.x, cursor.y, FALSE, 255);
drawImage(tileImage(BLANK_TILE), cursor.x, cursor.y, FALSE, 255);
}
else
{
e = isSpaceEmpty(&cursor.entity);
if (isValidOnMap(&cursor.entity) == 0 || e != NULL)
{
drawBox(game.screen, cursor.x, cursor.y, cursor.entity.w, cursor.entity.h, 255, 0, 0);
}
if (e != NULL)
{
setStatusPanelMessage("%s : %d %d", (strlen(e->objectiveName) == 0 ? e->name : e->objectiveName), (int)e->x, (int)e->y);
}
else
{
setStatusPanelMessage("");
}
cursor.entity.x = getMapStartX() + cursor.x;
cursor.entity.y = getMapStartY() + cursor.y;
self = &cursor.entity;
self->draw();
}
}
开发者ID:revcozmo,项目名称:edgar,代码行数:38,代码来源:cursor.c
示例6: getWidth
void RadioButton::draw(Graphics* graphics)
{
graphics->pushClipArea(Rectangle(1,
1,
getWidth() - 1,
getHeight() - 1));
drawBox(graphics);
graphics->popClipArea();
graphics->setFont(getFont());
graphics->setColor(getForegroundColor());
if (isFocused())
{
int fh;
if (getHeight()%2 == 0)
{
fh = getHeight() - 4;
}
else
{
fh = getHeight() - 3;
}
int hh = (fh + 1) / 2;
graphics->drawLine(0, hh + 1, hh + 1, 0);
graphics->drawLine(hh + 2, 1, fh + 2, hh + 1);
graphics->drawLine(fh + 1, hh + 2, hh + 1, fh + 2);
graphics->drawLine(hh + 1, fh + 2, 1, hh + 2);
}
int h = getHeight() + getHeight() / 2;
graphics->drawText(getCaption(), h - 2, 0);
}
开发者ID:Thann,项目名称:chaotic-rage,代码行数:38,代码来源:radiobutton.cpp
示例7: glClearColor
void GLWidget::paintGL()
{
glClearColor(0.0, 0.3, 0.0, 1);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
drawInfo();
m_camera->setUp();
m_light->setUp();
m_forklift->draw();
drawBox();
glFlush();
}
开发者ID:mujicadiazr,项目名称:Forklift,代码行数:23,代码来源:glwidget.cpp
示例8: printSelect
// Select a card to play
void printSelect(GlobalState* globalData) {
// LCD menu
clean(RED);
drawBoxFill(0, 0, 20, V - 1, RED);
drawBox(0, 0, 20, V - 1, 2, WHITE);
// Prints messages to LCD based off of keypad input
switch(globalData->keyStatus) {
case 0:
prints(35, 7, WHITE, RED, "Choose a card by its slot number:", 1);
break;
case 1:
prints(35, 7, WHITE, RED, "Invalid input. Please enter a key between 1 to 4:", 1);
break;
case 2:
prints(35, 7, WHITE, RED, "No card found. Please try again:", 1);
break;
}
// Display commands to select a slot - the LED's should indicate if a card is read
prints(35, 30, WHITE, BLACK, "Slot 1", 1);
prints(35, 60, WHITE, BLACK, "Slot 2", 1);
prints(35, 90, WHITE, BLACK, "Slot 3", 1);
prints(35, 120, WHITE, BLACK, "Slot 4", 1);
}
开发者ID:horsetailfiddlehead,项目名称:ee478,代码行数:24,代码来源:game.c
示例9: PainterShow
void PainterShow (KinoWidget w, LargeRegion r, Boolean move)
{
#ifdef DEBUG
fprintf (stderr, "+++ %s: (%d|%d)-(%dx%d)\n", __PRETTY_FUNCTION__,
r.x, r.y, r.width, r.height);
#endif
if (XtWindow (w) != None && w->kino.document && w->kino.painterEnable)
{
/* move all insets to their new places */
if (move) PainterRepositionInsets (w);
/* clear the exposed area */
XClearArea (XtDisplay (w), XtWindow (w),
r.x, r.y, r.width, r.height, False);
/* draw all Node elements */
drawBox (w, w->kino.document->root, 0, 0, r);
}
}
开发者ID:ekoeppen,项目名称:kino-2,代码行数:23,代码来源:Painter.c
示例10: drawSkyDome
void drawSkyDome(Vector position, int size, Texture *texture)
{
glDepthMask(GL_FALSE);
glDisable(GL_FOG);
glDisable(GL_BLEND);
glEnable(GL_TEXTURE_2D);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glBindTexture(GL_TEXTURE_2D, texture->data);
drawBox(position, 24, 24, 24, mission->skySphereSize);
glEnable(GL_FOG);
glDepthMask(GL_TRUE);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
}
开发者ID:lumidify,项目名称:blobandconquer,代码行数:23,代码来源:opengl.cpp
示例11: renderScene
void renderScene(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glPushMatrix();
glTranslatef(-0.2, 0, 0); // 平移
//glScalef(2, 1, 1); // 缩放
times++;
if(times > 100)
{
times = 0;
}
if(times % 100 == 0)
{
rotate += 0.3;
}
glRotatef(rotate, 0, 1, 0);
glRotatef(rotate, 1, 0, 0);
//
glColor3f(1, 0, 0);
//
// DrawCube();
drawBox(0,0,0,0.5,0.5,0.5);
glPopMatrix();
glutSwapBuffers();
}
开发者ID:chengsq,项目名称:cv,代码行数:36,代码来源:cube.cpp
示例12: drawTowerExplain
void drawTowerExplain() {
int startX = 125;
int startY = 20;
drawBox(startX,startY,40,22,0);
mvaddstr(startY+2,startX+8,"Tower Types");
mvaddch(startY+4, startX+3, basicLine | A_ALTCHARSET);
mvaddstr(startY+4,startX+5,"- Single shot tower (Attacks only");
mvaddstr(startY+5,startX+5," a single unit at a time)");
mvaddch(startY+7, startX+3, AOE | A_ALTCHARSET);
mvaddstr(startY+7,startX+5,"- Area of effect tower (Attacks");
mvaddstr(startY+8,startX+5," all units in the area)");
mvaddch(startY+10, startX+3, bomb | A_ALTCHARSET);
mvaddstr(startY+10,startX+5,"- Bomb tower (Attacks one unit,");
mvaddstr(startY+11,startX+5," and does splash damage to");
mvaddstr(startY+12,startX+5," nearby units)");
mvaddch(startY+14, startX+3, collat | A_ALTCHARSET);
mvaddstr(startY+14,startX+5,"- Collateral (Attacks one unit,");
mvaddstr(startY+15,startX+5," and chains to multiple");
mvaddstr(startY+16,startX+5," following units)");
mvaddch(startY+18, startX+3, reset | A_ALTCHARSET);
mvaddstr(startY+18,startX+5,"- Reset tower (Moves a unit to");
mvaddstr(startY+19,startX+5," the beginning of the pathway)");
}
开发者ID:iistyler,项目名称:Reverse-Tower-Defence-Game,代码行数:24,代码来源:Interface.c
示例13: perceptualGrouping
//.........这里部分代码省略.........
boxes[i].bottom.i = -1;
boxes[i].bottom.j = -1;
boxes[i].size = 0;
//for each positive blob
for(int j = 0;j < c;j++)
{
//if its in this group
if(positiveBlobs[j].group == i)
{
//add it to the bbox
boxes[i].size++;
boxes[i] = extendBox(boxes[i],positiveBlobs[j].top,positiveBlobs[j].bottom);
}
}
//for each negative blob
for(int j = 0;j < n;j++)
{
//if its in this group
if(negativeBlobs[j].group == i)
{
//add it to the bbox
boxes[i].size++;
boxes[i] = extendBox(boxes[i],negativeBlobs[j].top,negativeBlobs[j].bottom);
}
}
}
//for each box
for(int i = 0;i < groupCount;i++)
{
//if its got more than one thing in it
//printf("%i \n",boxes[i].size);
if(boxes[i].size > 1)
{
//draw it
drawBox(boxes[i],displayImage);
}
}
//show the image
cvSaveImage("grouping.png",displayImage);
cvNamedWindow("ImageWindow", CV_WINDOW_AUTOSIZE);
cvShowImage("ImageWindow", displayImage);
printf("Image displayed...\n");
//wait till key is pressed
printf("PRESS A KEY NOW...\n");
cvWaitKey(0);
//update img
int target[positiveSource.height][positiveSource.width];
for(int i = 0;i < positiveSource.height;i++)
{
for(int j = 0;j < positiveSource.width;j++)
{
int pos = positiveSource.labels[(i * positiveSource.width) + j];
pos = positiveMappings[pos];
if(pos != -1)
{
pos = positiveBlobs[pos].group;
pos = boxes[pos].size;
}
int neg = negativeSource.labels[(i * negativeSource.width) + j];
//int neg = -1;
neg = negativeMappings[neg];
if(pos != -1)
{
neg = negativeBlobs[neg].group;
neg = boxes[neg].size;
}
if(pos > 1 || neg > 1)
{
target[i][j] = 255;
}else
{
target[i][j] = 0;
}
}
}
uchar* data = (uchar *)img->imageData;
//copy new data into image
for(int i = 0; i < positiveSource.height;i++)
{
for(int j = 0; j < positiveSource.width; j++)
{
data[(i*img->widthStep) + j ] = target[i][j];
//printf("%i %i %u \n",i,j,test[i][j]);
}
}
img->imageData = (char*)data;
printf("Done\n");
}
开发者ID:mattcolliss,项目名称:Lexigraph,代码行数:101,代码来源:perceptualGrouping.c
示例14: drawBox
void EndLevel::draw()
{
if(m_visible)
{
txtcord+=dirmov*ft;
const Vector3D m_taille=m_size;
double mosaic=1;
Lighting::getInstance()->glEnableLighting();
if(m_selected)
drawBox();
glColor4ub(255,255,255,255);
if(m_texture!=NULL)
m_texture->bind();
glPushMatrix();
glTranslated(m_position.X,m_position.Y,m_position.Z);
Lighting::getInstance()->glDisableLighting();
glTranslated(0,0,m_taille.Z*2*0);
glDisable(GL_CULL_FACE);
m_texture->bind();
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
glEnable(GL_BLEND);
glBegin(GL_QUADS);
glNormal3d(0.0,1.0,0.0);
glTexCoord2d(0-txtcord.Y/100,m_taille.Z*2/mosaic-txtcord.X/100); glVertex3d(m_taille.X,m_taille.Y,m_taille.Z*2);
glTexCoord2d(0-txtcord.Y/100,0-txtcord.X/100); glVertex3d(m_taille.X,m_taille.Y,0);
glTexCoord2d(m_taille.X*2/mosaic-txtcord.Y/100,0-txtcord.X/100); glVertex3d(-m_taille.X,m_taille.Y,0);
glTexCoord2d(m_taille.X*2/mosaic-txtcord.Y/100,m_taille.Z*2/mosaic-txtcord.X/100); glVertex3d(-m_taille.X,m_taille.Y,m_taille.Z*2);
glNormal3d(1.0,0.0,0.0);
glTexCoord2d(0-txtcord.Y/100,m_taille.Z*2/mosaic-txtcord.X/100); glVertex3d(m_taille.X,-m_taille.Y,m_taille.Z*2);
glTexCoord2d(0-txtcord.Y/100,0-txtcord.X/100); glVertex3d(m_taille.X,-m_taille.Y,-m_taille.Z*0);
glTexCoord2d(m_taille.Y*2/mosaic-txtcord.Y/100,0-txtcord.X/100); glVertex3d(m_taille.X,m_taille.Y,-m_taille.Z*0);
glTexCoord2d(m_taille.Y*2/mosaic-txtcord.Y/100,m_taille.Z*2/mosaic-txtcord.X/100); glVertex3d(m_taille.X,m_taille.Y,m_taille.Z*2);
glNormal3d(0.0,-1.0,0.0);
glTexCoord2d(0-txtcord.Y/100,m_taille.Z*2/mosaic-txtcord.X/100); glVertex3d(-m_taille.X,-m_taille.Y,m_taille.Z*2);
glTexCoord2d(0-txtcord.Y/100,0-txtcord.X/100); glVertex3d(-m_taille.X,-m_taille.Y,-m_taille.Z*0);
glTexCoord2d(m_taille.X*2/mosaic-txtcord.Y/100,0-txtcord.X/100); glVertex3d(m_taille.X,-m_taille.Y,-m_taille.Z*0);
glTexCoord2d(m_taille.X*2/mosaic-txtcord.Y/100,m_taille.Z*2/mosaic-txtcord.X/100); glVertex3d(m_taille.X,-m_taille.Y,m_taille.Z*2);
glNormal3d(-1.0,0.0,0.0);
glTexCoord2d(0-txtcord.Y/100,m_taille.Z*2/mosaic-txtcord.X/100); glVertex3d(-m_taille.X,m_taille.Y,m_taille.Z*2);
glTexCoord2d(0-txtcord.Y/100,0-txtcord.X/100); glVertex3d(-m_taille.X,m_taille.Y,-m_taille.Z*0);
glTexCoord2d(m_taille.Y*2/mosaic-txtcord.Y/100,0-txtcord.X/100); glVertex3d(-m_taille.X,-m_taille.Y,-m_taille.Z*0);
glTexCoord2d(m_taille.Y*2/mosaic-txtcord.Y/100,m_taille.Z*2/mosaic-txtcord.X/100); glVertex3d(-m_taille.X,-m_taille.Y,m_taille.Z*2);
glEnd();
glDisable(GL_BLEND);
glPopMatrix();
glColor3ub(255,255,255);
Lighting::getInstance()->glEnableLighting();
}
}
开发者ID:AlIako,项目名称:PSNBL,代码行数:68,代码来源:EndLevel.cpp
示例15: drawTitle
//senquack - partial conversion to fixed point
//void drawTitle() {
// int i;
// int r, g, b;
// int sx, sy;
// char *stgChr = "STAGE";
// char *quitChr = "QUIT";
// char *mdChr[] = {"NORMAL MODE", "PSY MODE", "IKA MODE", "GW MODE"};
// int mdChrX[] = {270, 330, 330, 350};
// char mdIni[] = {'N', 'P', 'I', 'G'};
// drawTitleBoard();
//
// for ( i=-MODE_NUM ; i<STAGE_NUM+1 ; i++ ) {
// if ( i < 0 ) {
// if ( 4+i == mode ) {
// r = 100; g = 100; b = 240;
// } else {
// r = 150; g = 150; b = 200;
// }
// } else if ( i < QUIT_STAGE_NUM && hiScore.cleard[mode][i] ) {
// r = 240; g = 180; b = 180;
// } else {
// r = 210; g = 210; b = 240;
// }
// sx = stageX[i+MODE_NUM]; sy = stageY[i+MODE_NUM];
// if ( i == slcStg ) {
// int sz = STG_BOX_SIZE*3/2;
// if ( titleCnt < 16 ) sz = sz*titleCnt/16;
// drawBox(sx, sy, sz, sz, r, g, b);
// sz = sz*3/5;
// if ( i < 0 ) {
// int md = MODE_NUM+i;
// drawString(mdChr[md], mdChrX[md], 133, 12, 0, 150, 150, 200);
// drawLetter(mdIni[md]-'A'+10, sx, sy, sz, 0, 150, 150, 240);
// } else if ( i < QUIT_STAGE_NUM ) {
// makeStageStr(i);
// drawString(stageStr, sx-sz, sy, sz, 0, 210, 210, 240);
// drawString(stgChr, 330, 133, 12, 0, 210, 210, 240);
// drawString(stageStr, 445, 133, 12, 0, 210, 210, 240);
// drawNumCenter(hiScore.score[mode][i], 466, 168, 12, 210, 210, 240);
// } else {
// drawLetter('Q'-'A'+10, sx, sy, sz, 0, 210, 210, 240);
// drawString(quitChr, 410, 133, 12, 0, 210, 210, 240);
// }
// } else {
// drawBox(sx, sy, STG_BOX_SIZE/2, STG_BOX_SIZE/2, r*2/3, g*2/3, b*2/3);
// }
// }
// drawString(mdChr[mode], mdChrX[mode], 455, 12, 0, 150, 150, 200);
//}
void drawTitle() {
int i;
int r, g, b;
int sx, sy;
char *stgChr = "STAGE";
char *quitChr = "QUIT";
char *mdChr[] = {"NORMAL MODE", "PSY MODE", "IKA MODE", "GW MODE"};
int mdChrX[] = {270, 330, 330, 350};
char mdIni[] = {'N', 'P', 'I', 'G'};
drawTitleBoard();
for ( i=-MODE_NUM ; i<STAGE_NUM+1 ; i++ ) {
if ( i < 0 ) {
if ( 4+i == mode ) {
r = 100; g = 100; b = 240;
} else {
r = 150; g = 150; b = 200;
}
} else if ( i < QUIT_STAGE_NUM && hiScore.cleard[mode][i] ) {
r = 240; g = 180; b = 180;
} else {
r = 210; g = 210; b = 240;
}
sx = stageX[i+MODE_NUM]; sy = stageY[i+MODE_NUM];
if ( i == slcStg ) {
int sz = STG_BOX_SIZE*3/2;
if ( titleCnt < 16 ) sz = sz*titleCnt/16;
#ifdef FIXEDMATH
drawBox(INT2FNUM(sx), INT2FNUM(sy), INT2FNUM(sz), INT2FNUM(sz), r, g, b);
#else
drawBox(sx, sy, sz, sz, r, g, b);
#endif //FIXEDMATH
sz = sz*3/5;
if ( i < 0 ) {
int md = MODE_NUM+i;
drawString(mdChr[md], mdChrX[md], 133, 12, 0, 150, 150, 200);
// letter at top N/P/G/I
drawLetter(mdIni[md]-'A'+10, sx, sy, sz, 0, 150, 150, 240);
} else if ( i < QUIT_STAGE_NUM ) {
makeStageStr(i);
// 2-char stage ID below (1a, 2a, etc)
drawString(stageStr, sx-sz, sy, sz, 0, 210, 210, 240);
drawString(stgChr, 330, 133, 12, 0, 210, 210, 240);
drawString(stageStr, 445, 133, 12, 0, 210, 210, 240);
drawNumCenter(hiScore.score[mode][i], 466, 168, 12, 210, 210, 240);
} else {
// "q" for quit
//.........这里部分代码省略.........
开发者ID:senquack,项目名称:rRootage-for-Handhelds,代码行数:101,代码来源:attractmanager.c
示例16: drawField
/** draws the field */
void drawField(MotionDetect* md, const Field* field, const Transform* t) {
if (!md->fi.pFormat == PF_YUV)
return;
drawBox(md->currorig, md->fi.width, md->fi.height, 1, field->x, field->y,
field->size, field->size, t->extra == -1 ? 100 : 40);
}
开发者ID:mojaves-forks,项目名称:vid.stab,代码行数:7,代码来源:motiondetect.c
示例17: draw_car
void draw_car(CarDrawer* carDrawer)
{
//draw_axis(500.0);
// Car
glPushMatrix();
glTranslatef(carDrawer->car_pose.position.x,carDrawer->car_pose.position.y,carDrawer->car_pose.position.z+carDrawer->car_wheel_diameter/2);
glRotatef(90.0, 1.0, 0.0, 0.0);
glRotatef(0.0, 0.0, 1.0, 0.0);
glColor3f(0.3,0.3,0.3);
//glmDraw(carDrawer->carModel, GLM_SMOOTH | GLM_COLOR);
glmDraw(carDrawer->carModel, GLM_SMOOTH | GLM_COLOR | GLM_TEXTURE);
glPopMatrix();
// Sensor Board
glPushMatrix();
glTranslatef(carDrawer->sensor_board_1_pose.position.x,carDrawer->sensor_board_1_pose.position.y,carDrawer->sensor_board_1_pose.position.z);
glRotatef(carmen_radians_to_degrees(carDrawer->sensor_board_1_pose.orientation.yaw), 0.0f, 0.0f, 1.0f);
glRotatef(carmen_radians_to_degrees(carDrawer->sensor_board_1_pose.orientation.pitch), 0.0f, 1.0f, 0.0f);
glRotatef(carmen_radians_to_degrees(carDrawer->sensor_board_1_pose.orientation.roll), 1.0f, 0.0f, 0.0f);
// Xsens
glPushMatrix();
glTranslatef(carDrawer->xsens_pose.position.x,carDrawer->xsens_pose.position.y,carDrawer->xsens_pose.position.z);
glRotatef(carmen_radians_to_degrees(carDrawer->xsens_pose.orientation.yaw), 0.0f, 0.0f, 1.0f);
glRotatef(carmen_radians_to_degrees(carDrawer->xsens_pose.orientation.pitch), 0.0f, 1.0f, 0.0f);
glRotatef(carmen_radians_to_degrees(carDrawer->xsens_pose.orientation.roll), 1.0f, 0.0f, 0.0f);
glColor3f(1.0,0.6,0.0);
drawBox(carDrawer->xsens_size.x, carDrawer->xsens_size.y, carDrawer->xsens_size.z);
glPopMatrix();
// Laser
glPushMatrix();
glTranslatef(carDrawer->laser_pose.position.x, carDrawer->laser_pose.position.y, carDrawer->laser_pose.position.z);
glRotatef(carmen_radians_to_degrees(carDrawer->laser_pose.orientation.yaw), 0.0f, 0.0f, 1.0f);
glRotatef(carmen_radians_to_degrees(carDrawer->laser_pose.orientation.pitch), 0.0f, 1.0f, 0.0f);
glRotatef(carmen_radians_to_degrees(carDrawer->laser_pose.orientation.roll), 1.0f, 0.0f, 0.0f);
glColor3f(0.0,0.0,1.0);
drawBox(carDrawer->laser_size.x, carDrawer->laser_size.y, carDrawer->laser_size.z);
glPopMatrix();
glPopMatrix();
/*
glPushMatrix();
glPushMatrix();
glColor3f(0.3,0.3,0.3);
draw_wheel_axis(carDrawer->car_wheel_diameter,carDrawer->car_size.y);
glPushMatrix();
glTranslatef(carDrawer->car_axis_distance, 0.0, 0.0);
draw_wheel_axis(carDrawer->car_wheel_diameter,carDrawer->car_size.y);
glPopMatrix();
glColor3f(1.0,0.0,0.0);
glPushMatrix();
glTranslatef(carDrawer->car_pose.position.x,carDrawer->car_pose.position.y,carDrawer->car_pose.position.z+carDrawer->car_wheel_diameter/2);
glRotatef(carDrawer->car_pose.orientation.roll, 1.0f, 0.0f, 0.0f);
glRotatef(carDrawer->car_pose.orientation.pitch, 0.0f, 1.0f, 0.0f);
glRotatef(carDrawer->car_pose.orientation.yaw, 0.0f, 0.0f, 1.0f);
drawBox(carDrawer->car_size.x, carDrawer->car_size.y, carDrawer->car_size.z-carDrawer->car_wheel_diameter);
glPopMatrix();
glPopMatrix();
glPopMatrix();
*/
}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:86,代码来源:draw_car.c
示例18: drawRPanel_rotated
void drawRPanel_rotated() {
int y;
int ml;
// Show FPS
if (settings.show_fps) {
drawString(fpsStr, 167, 68, 6, 0, 200, 200, 200);
drawNumHoriz(fps(), 200, 68, 6, 200, 200, 200);
}
if ( left >= 0 ) {
//orig; had to be adjusted below to support screen-rotation:
// drawString(lStr, 40+480, 280, 18, 1, 200, 200, 222);
// drawLetter(left, 40+480, 420, 18, 1, 230, 180, 150);
drawString(lStr, 168, 33, 6, 0, 200, 200, 222);
drawLetter(left, 213, 33, 6, 0, 230, 180, 150);
switch ( mode ) {
case NORMAL_MODE:
//orig; had to be adjusted below to support screen-rotation:
// drawString(bStr, 90+480, 280, 18, 1, 200, 200, 222);
// drawLetter(bomb, 90+480, 420, 18, 1, 230, 180, 150);
drawString(bStr, 228, 33, 6, 0, 200, 200, 222);
drawLetter(bomb, 273, 33, 6, 0, 230, 180, 150);
break;
case PSY_MODE:
ml = ship.grzCnt/40;
//orig; had to be adjusted below to support screen-rotation:
// drawBox(550, 460, 50, 8, 120, 120, 120);
// drawBox(500+ml, 460, ml, 8, 210, 210, 240);
#ifdef FIXEDMATH
drawBox(INT2FNUM(425), INT2FNUM(20), INT2FNUM(50), INT2FNUM(8), 120, 120, 120);
drawBox(INT2FNUM(375+ml), INT2FNUM(20), INT2FNUM(ml), INT2FNUM(8), 210, 210, 240);
#else
drawBox(425, 20, 50, 8, 120, 120, 120);
drawBox(375+ml, 20, ml, 8, 210, 210, 240);
#endif //FIXEDMATH
break;
case GW_MODE:
ml = (ship.rfMtr-ship.rfMtrDec)/40;
//orig; had to be adjusted below to support screen-rotation:
// drawBox(550, 460, 50, 8, 120, 120, 120);
// drawBox(500+ml, 460, ml, 8, 210, 240, 210);
#ifdef FIXEDMATH
drawBox(INT2FNUM(425), INT2FNUM(20), INT2FNUM(50), INT2FNUM(8), 120, 120, 120);
drawBox(INT2FNUM(375+ml), INT2FNUM(20), INT2FNUM(ml), INT2FNUM(8), 210, 240, 210);
#else
drawBox(425, 20, 50, 8, 120, 120, 120);
drawBox(375+ml, 20, ml, 8, 210, 240, 210);
#endif //FIXEDMATH
if ( ml >= 50 ) {
// drawString(okStr, 540, 460, 10, 0, 230, 240, 230);
//orig; had to be adjusted below to support screen-rotation:
drawString(okStr, 415, 20, 10, 0, 230, 240, 230);
}
break;
}
}
//these are disabled under rotated mode:
// y = 24;
// drawString(stageStr, 124+480, y, 24, 1, 200, 200, 222);
// y += 24*1.7f*2;
// drawLetter(38, 124+480, y, 24, 1, 200, 200, 222);
// y += 24*1.7f;
// drawNumRight(scene+1, 124+480, y, 24, 200, 200, 222);
if (status != TITLE)
{
if (mode == NORMAL_MODE) {
drawString(stageStr, 288, 33, 6, 0, 200, 200, 222);
drawLetter(38, 305, 33, 6, 0, 200, 200, 222);
drawNumCenter(scene+1, 312, 33, 6, 200, 200, 222);
} else {
// Draw this farther to left since we're not displaying bomb amount in these modes
drawString(stageStr, 228, 33, 6, 0, 200, 200, 222);
drawLetter(38, 245, 33, 6, 0, 200, 200, 222);
drawNumCenter(scene+1, 252, 33, 6, 200, 200, 222);
}
}
}
开发者ID:senquack,项目名称:rRootage-for-Handhelds,代码行数:83,代码来源:attractmanager.c
示例19: drawTitleMenu
void drawTitleMenu() {
int i;
char *stgChr = "STAGE";
char *endlessChr = "ENDLESS";
char *hardChr = "HARD";
char *extChr = "EXTREME";
char *insChr = "INSANE";
char *quitChr = "QUIT";
for ( i=0 ; i<STG_BOX_NUM ; i++ ) {
if ( i == slcStg ) {
int sz = STG_BOX_SIZE+6+sctbl[(titleCnt*16)&(DIV-1)]/24;
drawBox(stageX[i], stageY[i], sz, sz, 16*2-14, 16*2-3, buf);
if ( i < STAGE_NUM ) {
drawStringBuf(stgChr, 180, 80, 12, 2, 16*1-14, 16*1-2, buf, 0);
drawNumCenter(i+1, 308, 80, 12, 16*1-14, 16*1-2);
} else {
switch ( i ) {
case 10:
drawStringBuf(endlessChr, 188, 80, 12, 2, 16*1-14, 16*1-2, buf, 0);
break;
case 11:
drawStringBuf(endlessChr, 93, 80, 12, 2, 16*1-14, 16*1-2, buf, 0);
drawStringBuf(hardChr, 248, 80, 12, 2, 16*1-14, 16*1-2, buf, 0);
break;
case 12:
drawStringBuf(endlessChr, 36, 80, 12, 2, 16*1-14, 16*1-2, buf, 0);
drawStringBuf(extChr, 190, 80, 12, 2, 16*1-14, 16*1-2, buf, 0);
break;
case 13:
drawStringBuf(endlessChr, 56, 80, 12, 2, 16*1-14, 16*1-2, buf, 0);
drawStringBuf(insChr, 210, 80, 12, 2, 16*1-14, 16*1-2, buf, 0);
break;
case 14:
drawStringBuf(quitChr, 230, 80, 12, 2, 16*1-14, 16*1-2, buf, 0);
break;
}
}
if ( i < STAGE_NUM+ENDLESS_STAGE_NUM ) {
drawNumCenter(hiScore.stageScore[i], 308, 112, 12, 16*1-14, 16*1-2);
}
}
drawBox(stageX[i], stageY[i], STG_BOX_SIZE, STG_BOX_SIZE, 16*1-14, 16*1-3, buf);
if ( i < 9 ) {
drawNumCenter(i+1, stageX[i], stageY[i], 12, 16*1-16, 16*1-1);
} else {
switch ( i ) {
case 9:
drawNumCenter(10, stageX[i]+8, stageY[i], 12, 16*1-16, 16*1-1);
break;
case 10:
drawLetterBuf('E'-'A'+10, stageX[i], stageY[i], 12, 2, 16*1-16, 16*1-1, buf, 0);
break;
case 11:
drawLetterBuf('E'-'A'+10, stageX[i]-8, stageY[i], 12, 2, 16*1-16, 16*1-1, buf, 0);
drawLetterBuf('H'-'A'+10, stageX[i]+8, stageY[i], 12, 2, 16*1-16, 16*1-1, buf, 0);
break;
case 12:
drawLetterBuf('E'-'A'+10, stageX[i]-8, stageY[i], 12, 2, 16*1-16, 16*1-1, buf, 0);
drawLetterBuf('E'-'A'+10, stageX[i]+8, stageY[i], 12, 2, 16*1-16, 16*1-1, buf, 0);
break;
case 13:
drawLetterBuf('E'-'A'+10, stageX[i]-8, stageY[i], 12, 2, 16*1-16, 16*1-1, buf, 0);
drawLetterBuf('I'-'A'+10, stageX[i]+8, stageY[i], 12, 2, 16*1-16, 16*1-1, buf, 0);
break;
case 14:
drawLetterBuf('Q'-'A'+10, stageX[i], stageY[i], 12, 2, 16*1-16, 16*1-1, buf, 0);
break;
}
}
}
}
开发者ID:kazuya-watanabe,项目名称:noiz2sa,代码行数:71,代码来源:attractmanager.c
示例20: simLoop
// simulation loop
static void simLoop (int pause)
{
const dReal *rot;
dVector3 ax;
dReal l=0;
switch (joint->getType() )
{
case dJointTypeSlider :
( (dSliderJoint *) joint)->getAxis (ax);
l = ( (dSliderJoint *) joint)->getPosition();
break;
case dJointTypePiston :
( (dPistonJoint *) joint)->getAxis (ax);
l = ( (dPistonJoint *) joint)->getPosition();
break;
default:
{} // keep the compiler happy
}
if (!pause)
{
double simstep = 0.01; // 1ms simulation steps
double dt = dsElapsedTime();
int nrofsteps = (int) ceilf (dt/simstep);
if (!nrofsteps)
nrofsteps = 1;
for (int i=0; i<nrofsteps && !pause; i++)
{
dSpaceCollide (space,0,&nearCallback);
dWorldStep (world, simstep);
dJointGroupEmpty (contactgroup);
}
update();
dReal radius, length;
dsSetTexture (DS_WOOD);
drawBox (geom[BODY2], 1,1,0);
drawBox (geom[RECT], 0,0,1);
if ( geom[BODY1] )
{
const dReal *pos = dGeomGetPosition (geom[BODY1]);
rot = dGeomGetRotation (geom[BODY1]);
dsSetColor (0,0,1);
dGeomCapsuleGetParams (geom[BODY1], &radius, &length);
dsDrawCapsule (pos, rot, length, radius);
}
drawBox (geom[OBS], 1,0,1);
// Draw the prismatic axis
if ( geom[BODY1] )
{
const dReal *pos = dGeomGetPosition (geom[BODY1]);
rot = dGeomGetRotation (geom[BODY2]);
dVector3 p;
p[X] = pos[X] - l*ax[X];
p[Y] = pos[Y] - l*ax[Y];
p[Z] = pos[Z] - l*ax[Z];
dsSetColor (1,0,0);
dsDrawCylinder (p, rot, 3.75, 1.05*AXIS_RADIUS);
}
if (joint->getType() == dJointTypePiston )
{
dVector3 anchor;
dJointGetPistonAnchor(joint->id(), anchor);
// Draw the rotoide axis
rot = dGeomGetRotation (geom[BODY2]);
dsSetColor (1,0.5,0);
dsDrawCylinder (anchor, rot, 4, AXIS_RADIUS);
dsSetColor (0,1,1);
rot = dGeomGetRotation (geom[BODY1]);
dsDrawSphere (anchor, rot, 1.5*RADIUS);
}
}
}
开发者ID:CentreForBioRobotics,项目名称:lpzrobots,代码行数:96,代码来源:demo_piston.cpp
注:本文中的drawBox函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论