opengl 怎么画一个汽车 并且可以控制它的移动 1C

opengl 怎么画一个汽车 并且可以控制它的移动，主要的问题是要实现轮子的自传，就是绕圆心转动

2个回答

RuningXJ 回复人类新纪元开始了: 这个rar文件怎么用啊，从没接触过这个opengl

RuningXJ 回复人类新纪元开始了: 这个rar文件怎么用啊，从没接触过这个opengl

lois_wjj 留下邮箱，回去发你

RuningXJ 回复lois_wjj: 一开始也是这么想的，后来过程有点儿复杂，可以提供一份代码吗

OpenGL画十字线相关的问题

OpenGL-如何画出一个三维图形

opengl怎么画这样的曲线

<div class="post-text" itemprop="text"> <p>I am trying to learn modern OpenGL and want to draw a triangle like this: <img src="https://i.stack.imgur.com/h6FJX.png" alt="http://www.opengl-tutorial.org/wp-content/uploads/2011/04/red_triangle.png"></p> <p>I am following this tutorial: <a href="http://www.opengl-tutorial.org/beginners-tutorials/tutorial-2-the-first-triangle/" rel="nofollow noreferrer">www.opengl-tutorial.org/beginners-tutorials/tutorial-2-the-first-triangle/</a>, but all I get is the dark blue background (clear color). What could be wrong with this code?</p> <p>I am writing this in Go and tried to run it on Ubuntu and OS X. Note: I am using the glfw 3 library instead of glfw 2.7 that is used in the tutorial.</p> <p>I think the relevant parts are:</p> <pre><code>func setup() { gl.ClearColor(0.0, 0.0, 0.4, 0.0) makeProgram(vertexShaderSource,fragmentShaderSource) vertexBufferData := []float32{ -1,-1,0, 1,-1,0, 0, 1,0, } vertexBuffer = gl.GenBuffer() vertexBuffer.Bind(gl.ARRAY_BUFFER) gl.BufferData(gl.ARRAY_BUFFER, len(vertexBufferData)*4, vertexBufferData, gl.STATIC_DRAW) } func draw() { gl.Clear(gl.COLOR_BUFFER_BIT) program.Use() // first attribute buffer: vertices var vertexAttrib = program.GetAttribLocation("vertexPosition_modelspace") vertexAttrib.EnableArray() vertexBuffer.Bind(gl.ARRAY_BUFFER) var f float32 = 0.0 vertexAttrib.AttribPointer( 3, // size gl.FLOAT, // type false, // normalized 0, // stride &amp;f) // array buffer offset // draw the triangle gl.DrawArrays(gl.TRIANGLES, 0, 3) vertexAttrib.DisableArray() } </code></pre> <p>Link to the full code: <a href="https://gist.github.com/mbertschler/8672365" rel="nofollow noreferrer">https://gist.github.com/mbertschler/8672365</a></p> <p>I already tried to debug this with OpenGL Profiler on OSX, but it shows me no errors so far.</p> </div>

OpenGL画一棵树，在自己电脑上正常运行。转移到别人电脑上后出现问题，附图片，请大神帮我看一下，谢谢。

OpenGL关于画圆饼的问题

#include<GL/glut.h> #include<stdlib.h> #include<math.h> const GLdouble twoPi = 6.283185; class scrPr { public: GLint x, y; }; GLsizei winWidth = 400, winHeight = 300; scrPr circCtr, piePr; GLint radius = winWidth / 4; void init(void) { glClearColor(1.0, 1.0, 1.0, 1.0); glMatrixMode(GL_PROJECTION); gluOrtho2D(0.0, 200.0, 0.0, 150.0); } void circleMidpoint(scrPr &cir, int r) //中点画圆函数 { int x = cir.x, y = cir.y, d, deltax, deltay; deltax = 3; deltay = 2 - r - r; d = 1 - r; glVertex2i(x, y); while (x<y) { if (d<0) { d += deltax; deltax += 2; x++; } else { d += (deltax + deltay); deltax += 2; deltay += 2; x++; y--; } glVertex2i(x, y); glVertex2i(y, x); glVertex2i(x, cir.y+cir.y-y); glVertex2i(cir.y + cir.y - y, x); glVertex2i(cir.x+cir.x-x,y); glVertex2i(y, cir.x + cir.x - x); glVertex2i(cir.x + cir.x - x, cir.y + cir.y - y); glVertex2i(cir.y + cir.y - y, cir.x + cir.x - x); } } void pieChart(void) { GLdouble sliceAngle, previousSliceAngle = 0.0; GLint k, nSlices = 12; GLfloat dataValues[12] = { 10.0, 7.0, 13.0, 5.0, 13.0, 14.0, 3.0, 16.0, 5.0, 3.0, 17.0, 8.0 }; GLfloat dataSum = 0.0; glClear(GL_COLOR_BUFFER_BIT); glColor3f(0.0, 0.0, 0.0); circCtr.x = winWidth / 2; circCtr.y = winHeight / 2; glBegin(GL_POINTS); circleMidpoint(circCtr, radius); glEnd(); for ( k = 0; k <nSlices; k++) { dataSum += dataValues[k]; } for ( k = 0; k <nSlices; k++) { sliceAngle = twoPi*dataValues[k] / dataSum + previousSliceAngle; piePr.x = circCtr.x + radius*cos(sliceAngle); piePr.y = circCtr.x + radius*sin(sliceAngle); glBegin(GL_LINES); glVertex2i(circCtr.x, circCtr.y); glVertex2i(piePr.x, piePr.y); glEnd(); previousSliceAngle = sliceAngle; } } void displayFunc(void) { glClear(GL_COLOR_BUFFER_BIT); glColor3f(0.0, 0.0, 1.0); pieChart(); glFlush(); } void winReshapeFcn(int newWidth, int newHeight) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0.0, GLdouble(newWidth), 0.0, GLdouble(newHeight)); glClear(GL_COLOR_BUFFER_BIT); winWidth = newWidth; winHeight = newHeight; } void main(int argc, char**argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutInitWindowPosition(100, 100); glutInitWindowSize(winWidth,winHeight); glutCreateWindow("pieChart"); init(); glutDisplayFunc(displayFunc); glutReshapeFunc(winReshapeFcn); glutMainLoop(); } 要的效果是一个圆饼。但是我只能得到一族以圆心为中心的射线，得不到圆饼图。求解答！！！

OPENGL的画刷技术如何实现

opengl中 视景体会随着视点的移动而移动吗？

void Ctest1View::OnDestroy() { CView::OnDestroy(); ::wglMakeCurrent(NULL, NULL); ::wglDeleteContext(m_hRC); } void Ctest1View::OnSize(UINT nType, int cx, int cy) { CView::OnSize(nType,cx,cy); glViewport(0,0,cx,cy); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-cx / 2, cx / 2, -cy / 2, cy / 2, -10, 10); } int Ctest1View::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CView::OnCreate(lpCreateStruct)==-1) { return -1; } gl_Init(); return 0; } void Ctest1View::Draw() { gl_Transform(); glClearColor(1.0f,1.0f,1.0f,1.0f); glClear(GL_COLOR_BUFFER_BIT); glColor3f(0.0f,0.0f,0.0f); for (int i = 0; i < 100; i++) { gl_Point(i, 0); } glFlush(); SwapBuffers(m_hDc); } void Ctest1View::gl_Init() { PIXELFORMATDESCRIPTOR pfd = { sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, PFD_TYPE_RGBA, 24, 0,0,0,0,0,0, 0,0,0, 0,0,0,0, 32, 0, 0, PFD_MAIN_PLANE, 0, 0,0,0, }; m_hDc = GetDC()->GetSafeHdc(); int nPixelFomat = ::ChoosePixelFormat(m_hDc,&pfd); ::SetPixelFormat(m_hDc,nPixelFomat,&pfd); m_hRC = ::wglCreateContext(m_hDc); ::wglMakeCurrent(m_hDc,m_hRC); } void Ctest1View::gl_Transform() { RECT r; GetClientRect(&r); glOrtho(0 ,r.right/2,-r.bottom/2,r.top /2,-10,10); } void Ctest1View::gl_Point(GLint x,GLint y) { glBegin(GL_POINTS); glVertex2d(x,y); glEnd(); } // Ctest1View 绘制 void Ctest1View::OnDraw(CDC* /*pDC*/) { Ctest1Doc* pDoc = GetDocument(); ASSERT_VALID(pDoc); //if (!pDoc) // return; Draw(); // TODO: 在此处为本机数据添加绘制代码 } 哪有错么 累人百度了好久还是不会解决

opengl 可以导出画的三维图形吗

OpenGL画点，为什么点的坐标值超出[-1,1]范围就显示不了？？？

QT的界面，底层是不是用OpenGL画出来的？

1、QT的各种界面是不是用OpenGL画出来的？然后在处理控件响应？ 2、QT开发任何程序都不用操作系统API吗？只用QT就能开发任何程序？ 3、如果第二种不满足，那哪类程序需调用API？

2020阿里全球数学大赛：3万名高手、4道题、2天2夜未交卷

HashMap底层实现原理，红黑树，B+树，B树的结构原理 Spring的AOP和IOC是什么？它们常见的使用场景有哪些？Spring事务，事务的属性，传播行为，数据库隔离级别 Spring和SpringMVC，MyBatis以及SpringBoot的注解分别有哪些？SpringMVC的工作原理，SpringBoot框架的优点，MyBatis框架的优点 SpringCould组件有哪些，他们...

《Oracle Java SE编程自学与面试指南》最佳学习路线图2020年最新版（进大厂必备）

《Oracle Java SE编程自学与面试指南》最佳学习路线图（2020最新版）