问题标签 [opengl-compat]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - 所有多边形都变得透明,如何修复?
我在我的项目中做了一些事情,所有的多边形都变得透明了。
我下载了我的旧 git,一切都很好,但它仍然是透明的。
Tick 事件:在渲染所有多边形绘图中
最后更改的功能:
c - 将弹丸模拟转换为 3D 会导致绘图消失?
我有一个成功绘制 2D 射弹的代码,但我需要应用更改以使其成为 3D。
为了使其成为 3D,我将 glVertex2d 更改为 glVertex3d,设置变量 z 并将其添加到 glVertex3d。我得到的最终代码:
但它没有显示任何错误,只是显示一个黑色窗口。
PS 我正在使用 OpenGL 和 freeglut
opengl - OpenGL重叠丑陋渲染
我正在尝试使用 OpenGL 2.1 渲染场景,但重叠形状的边界很奇怪。我测试了一些 OpenGL 初始化,但没有任何变化。我将问题简化为具有相同结果的 2 个球体的简单测试应用程序。
我尝试了一些关于 Gl_DEPTH_TEST 的事情,启用/禁用平滑但没有成功。
这是我使用 2 gluSphere 的结果:
当一条线足以分开蓝色和红色的脸时,我们可以看到某种混叠......
我使用SharpGL,但我认为它并不重要(因为我只将它用作 OpenGL 包装器)。这是我最简单的代码来呈现相同的东西(您可以将其复制到表单中进行测试):
提前感谢您的建议!
编辑 :
我测试了没有成功:
EDIT2:有更多的面孔,有和没有线条的图像
它是......不同......但并不令人愉快。
c++ - 在中心而不是在一个顶点合并颜色顶点?
我正在尝试制作一个色板工具,在其中你给它 n 种颜色,它会制作一个 n 边形,这些颜色在中心合并。
到目前为止,它只是制作了一个 n-gon(没有指定颜色,它现在随机生成它们)。
然而,颜色不会在中心合并,而是在单个顶点处合并。
有什么解决办法吗?
c++ - How I can use Keyboard interaction in this code
i want to use keyboard key to move the object on the path but after using keyboard function the object is not moving.Please help me with this.after applying keyboard function the object is not moving from its place.
i want to add 3 different function for wave/path so keyboard interaction is necessary for me, so that i may able to use different keys for different scenes.
c++ - c ++ cuda opengl不渲染vbo
我正在尝试在屏幕上绘制一堆点。我正在使用 CUDA 生成数据(位置和颜色),并使用 OpenGL 来绘制它。我试图让 CUDA 更新 VBO,然后 OpenGL 来绘制它,但我得到一个空白屏幕。我不确定 CUDA 是否无法更新缓冲区,或者缓冲区没有正确绘制。我的 GPU 是 GTX 1080,我正在尝试使用 OpenGL 4.0。颜色也由 CUDA 指定。如果我的问题是我需要一个着色器,我该如何添加它,但还要通过 CUDA 指定颜色?
更新:问题似乎是openGL。更新代码以使用三角形所以要添加新问题。为什么我的 VBO 没有被渲染?
这是代码:
GPUmain.cuh:
GPUmain.cu:
window.cpp 的相关(包含 OpenGL 代码)部分:
c++ - Plotting graphs with glVertex2i() shows artefacts when scaled with glScaled()
I'm using OpenGL to plot an RGB image histogram. As this is an 8-bit image histogram, my data-set contains data points from zero to 255.
If I plot the histogram without using glScaled() then the graph plots as expected but, of course, does not fill the allocated area (the width of which is variable, the height constant). However, when I use glScaled() the graph shows strange artefacts.
Please see the following images to see an example of the problem:
The image above shows the histogram as plotted with 256 data points without being scaled with glScaled().
The two images above shows the histogram as plotted with 256 data points AND being scaled with glScaled(). The strange artefacts are evident (missing data?). Please note, the third histogram is a slightly different shape due to changing light levels.
Here is the relevant part of my OpenGL initialisation code:
And here is the relevant part of my plot code:
At this stage I feel that I must state that I am new to OpenGL, so it's possible that I have misunderstood many OpenGL things...
My question is: Is it possible to fix this problem in OpenGL or will I have to increase the number of data points by some kind of interpolation and then plot without scaling?
I appreciate any help offered.
java - 我可以为 OpenGL 中的静态对象推送一次矩阵吗?
我需要了解我可以为我的项目调用 glBegin、glEnd 一次。
我尝试调用 myRender 函数一次,而不是每次滴答,但它会在第二帧删除所有多边形。
我的滴答事件
我试过这个
我需要计算 myMatrix 一次,以进行项目优化。另外,如果我能做到,我还有第二个问题。我可以一次绘制静态多边形,并且每次滴答都在渲染函数中绘制非静态(移动)多边形吗?
c++ - 沿opengl中的路径旋转
我想沿着路径(正弦波)移动物体,假设物体是过山车。它通过翻译移动,但我的问题是我还想根据路径旋转该对象。
我在翻译之前尝试了这段代码,但它不起作用。
我只有翻译的代码看起来像这样。我想在这里沿正弦波添加旋转