本文整理汇总了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);
}
示例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();
}
示例3: drawAxes
void SmokeSim::draw(const Camera& c) {
drawAxes();
mGrid.draw(c);
if (mRecordEnabled) {
grabScreen();
}
}
示例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();
}
示例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();
}
示例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);
}
}
示例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);
}
示例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();
}
示例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);
}
示例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();
}
示例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
}
示例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();
}
示例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;
}
示例14: drawMagnitudes
void AnalysisView::runAnalysis() {
drawMagnitudes();
drawSubbands();
drawAxes();
drawClipping();
}
示例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();
}