OpenGL : glRotatef not working?
OpenGL : glRotatef not working?
glRoatef函数不起作用我不知道为什么。。。
下面的代码这是显示函数,它在主循环中也使用SDL调用:
void display(){
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
GLfloat ambientColor[] = {0.2f, 0.2f, 0.2f, 1.0f};
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambientColor);
Control(0.2,0.2,mousein);
drawSkybox(50.0);
UpdateCamera();
renderLine(0,0,0,100,0,0,0,0,255);
renderLine(0,0,0,0,100,0,0,255,0);
renderLine(0,0,0,0,0,100,255,0,0);
我忘了补充一下,这是不起作用的一点:
glPushMatrix();
glRotatef(1,0,0,360);
glScalef(0.05,0.05,0.05);
glCallList(ship);
glPopMatrix();
for(int i = 0;i<planets.size();i++){
glPushMatrix();
planets[i].render();
glPopMatrix();
}
}
在控制功能中,这些旋转起作用。
glRotatef(-camPitch,1.0,0.0,0.0);glRotatef(-camYaw,0.0,1.0,0.0);
"更新摄影机"还平移场景glTranslatef(-camX、-camY、-camZ);
在init函数中,这也是我设置相机的方式
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45,640.0/480.0,0.1,500.0);
glMatrixMode(GL_MODELVIEW);
void glRotatef(GLfloat x,GLfloat y,GLfloot z,GLflot角度)
void glRotatef(GLfloat角度、GLfloat x、GLfloast y、GLfloot z);
http://www.opengl.org/sdk/docs/man2/xhtml/glRotate.xml
相关文章:
- GDB - strcmp not working: __strcmp_sse2_unaligned
- QT qScriptConnect is not working
- QDesktopServices::openUrl() not working Qt
- "Configure: Error: Could Not Find a Working Compiler, See config.log For Details"
- C++ std::set ordering not working with customer class*
- C++ SetWindowText not working
- visual studio 2012 c++ hello world - iostream not working
- getGravity not working?
- Opencv findcontours CV_RETR_EXTERNAL not working
- c++ srand() not working
- std::queue::empty() not working?
- BCB swprintf not working
- 将类型作为指向另一个类的对象的指针的泛型类-NOT WORKING
- LoadLibrary is not working
- gluUnProject not working
- C++ catch bad_alloc not working
- updatelayeredwindow not working
- OpenMP set_num_threads() is not working
- glOrtho not working
- Cuda atomicInc not working