Questions tagged [opengl-compat]

This tag is for questions about the Compatibility profile of desktop OpenGL. Questions using fixed-function, immediate-mode rendering, texture environment fragment processing, and other features removed from core OpenGL in 3.2.

Related to drawing by glBegin/glEnd sequences, the fixed function matrix stack and Blinn-Phong per vertex (Gouraud) light model.

317 questions
7
votes
1 answer

OpenGL render view without a visible window in python

I need to render some scene. I managed to do it in python using pyopengl and pygame. The problem is that it creates a window for a short period of time. I want to render the same image and save it, without creating a visible window (Or possibly…
user972014
  • 1,829
  • 32
  • 58
7
votes
2 answers

Not understanding the gluOrtho2D function

I am not able to what gluOrtho2D() function is doing? Is it fixing the origin at some particular point on the OpenGL window or something else? This is because gluOrtho2D(1,1,1,1) fixes the origin at the middle of the window. If it is not fixing the…
ajaysinghnegi
  • 1,651
  • 1
  • 16
  • 33
6
votes
1 answer

Draw a polygon in OpenGL GLUT with mouse

i want to draw a polygon in openGL Glut with mouse interaction, every left click that will be made will be a vertex and a line will be drawn between every vertex. when the right mouse will be clicked the polygon will close drawing a line from the…
leo_bouts
  • 190
  • 1
  • 14
5
votes
1 answer

How create a camera on PyOpenGL that can do "perspective rotations" on mouse movements?

I am creating a first-person view RPG and I want to rotate the camera in PyOpenGL when I move the mouse (just like some other games like Minecraft). What function can I use to do this and how? I tried to use gluLookAt() but I don't understand how it…
Noah
  • 435
  • 3
  • 15
5
votes
3 answers

OpenGL overlapping ugly rendering

I'm trying to render a scene with OpenGL 2.1 but the borders on overlapping shapes are weird. I tested some OpenGL initialisations but without any change. I reduce my issue to a simple test application with 2 sphere with the same result. I tried…
KiwiJaune
  • 204
  • 1
  • 8
4
votes
1 answer

Texture for Torus is not applying properly

I'm creating a open GL program with 6 Torus. When I applied the texture it's displaying with one color. Even though it's not in a single color. I'm getting images from array. Other textures (skybox, planet, HUD) are applying properly except Torus…
AbRe
  • 133
  • 7
4
votes
1 answer

Child window with OpenGL not responding to gluOrtho2D()

I created a child window using WinAPI, now I'm trying to draw a triangle there. It is drawn, but its scale is not correct. I think this is due to the fact that I have not properly installed orthogonal system. It is set in the init() function, I call…
German
  • 323
  • 1
  • 7
4
votes
1 answer

How do I bring a polygon to the foreground in OpenGL?

The code below creates 2 square polygons, red and green. I'm trying to place a red square on top of the green, but I can't. The depth buffer is declared, cleaned when necessary, an orthogonal system is configured correctly. If I specify a value…
German
  • 323
  • 1
  • 7
4
votes
1 answer

How to blit a png image as an image overlay in PyOpenGL?

I am making a game in PyOpenGL and want to blit some images onto the screen as some overlay (for example, the pause button). How can I do that? I've tried using glBitmap(), but it doesn't work. This is what I have: pauseimg = pygame.image.load(path…
Noah
  • 435
  • 3
  • 15
4
votes
1 answer

GL_LINES not showing up on top of cube?

I am trying to create a 3d Rubiks Cube with OpenGL and Pygame. However I when I try to draw lines on top of the GL_QUADS surfaces I have created, they don't show up. I have tried putting the GL_LINES after the GL_QUADS line but it they still do…
user11462125
4
votes
1 answer

Rotate object like a real wind turbine

#include #include #include "glut.h" void init() { glClearColor(0.0, 0.0, 0.0, 0.0); glMatrixMode(GL_PROJECTION); gluOrtho2D(0.0, 400, 0.0, 300.0); } void drawTurbine() { // draw the tower glBegin(GL_LINES); …
Muddy
  • 592
  • 2
  • 10
3
votes
1 answer

2D white grid not displaying above background

I'm trying to create a 2D hollow grid on top of a purple background; however, what's being displayed whenever I create the grid is a white window. I created the 2D grid using GL_Lines, as I only wanted the borders to be colored white and not the…
Hoda
  • 361
  • 1
  • 6
3
votes
1 answer

Why does my pyglet application draw funny?

My pyglet application to view 3-d objects in STL format is acting funny. when I load a stl file, it works fine, but then when I try to draw it, it acts funny. code doesn't crash, but the test file I loaded for a cube doesn't look right. I think it…
HennieP12
  • 33
  • 4
3
votes
1 answer

confusion about glPerspective and GL_POLYGON

I am confused about how glPerspective works. I know in theory what it does but I am confused about it when trying to use it. Here is my code (I used Pygame to create the window): import pygame, sys from OpenGL.GL import * from OpenGL.GLU import…
3
votes
1 answer

OpenGL python and pygame translation after rotation not working for mouselook and movement

I'm trying to make a simple mouse look with standard arrow key movement, and I've got the mouselook working but the translations from the rotated points seem to move along an orthogonal basis, but not one that is aligned with the rotation of the…
1
2 3
21 22