#include "stdafx.h"
#include <GL/glut.h>
#include <stdlib.h>
#include <math.h>
#include <stdio.h>

void myDisplay(void) {
    glClear(GL_COLOR_BUFFER_BIT);
    glPointSize(5.0f);    //修改点的尺寸,默认大小为1.0f
    glBegin(GL_POINTS);
    glVertex2f(0.0f, 0.0f);
    glVertex2f(0.5f, 0.5f);
    glVertex2f(-0.5f, 0.0f);
    glEnd();
    glFlush();
}

int main(int argc, char *argv[]){
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
    glutInitWindowPosition(100, 100);
    glutInitWindowSize(500, 500);
    glutCreateWindow("OpenGL画圆程序");
    glutDisplayFunc(&myDisplay);
    glutMainLoop();
    return 0;
}

运行结果:

【openGL】关于画点

 

相关文章:

  • 2021-09-04
  • 2021-07-26
  • 2021-10-30
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
  • 2022-02-12
猜你喜欢
  • 2021-08-22
  • 2021-12-23
  • 2021-11-16
  • 2021-12-21
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案