添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
奋斗的馒头  ·  校园里,赴春风之约 ...·  3 周前    · 
纯真的围巾  ·  python ...·  4 月前    · 
文武双全的刺猬  ·  error: Raw AIDL ...·  7 月前    · 
Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode . Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

Thanks! I have now modified the code:
Now trying to plot a tetrahedron, which I got from an old textbook (qt4).

void Tetrahedron::draw()
    static const GLfloat P1[3] = { 0.0, -1.0, +2.0 };
    static const GLfloat P2[3] = { +1.73205081, -1.0, -1.0 };
    static const GLfloat P3[3] = { -1.73205081, -1.0, -1.0 };
    static const GLfloat P4[3] = { 0.0, +2.0, 0.0 };
    static const GLfloat * const coords[4][3] = {
    { P1, P2, P3 }, { P1, P3, P4 }, { P1, P4, P2 }, { P2, P4, P3 }
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    glTranslatef(0.0, 0.0, -10.0);
    glRotatef(rotationX, 1.0, 0.0, 0.0);
    glRotatef(rotationY, 0.0, 1.0, 0.0);
    glRotatef(rotationZ, 0.0, 0.0, 1.0);
    for (int i = 0; i < 4; ++i) {
    glLoadName(i);
    glBegin(GL_TRIANGLES);
//    qglColor (faceColors[i]);
    glColor3f(1,0.3,1);
    for (int j = 0; j < 3; ++j) {
    glVertex3f(coords[i][j][0], coords[i][j][1],
    coords[i][j][2]);
    glEnd();

the problem is qglColor (faceColors[I]); does not work anymore with the new qt version! I could not find out how this should be changed?

Also, almost every opengl code I (as a beginner) find on the internet is unusable with changes made in QT6, which brings me to the question what is the point of all the changes...