33 questions
1
vote
1
answer
92
views
Why isn't this program correctly texturing models?
I'm trying to basic 3D rendering working using OpenGL 1.1:
#define GLFW_INCLUDE_GLU
#include <GLFW/glfw3.h>
#include <gl/GL.h>
#include <gl/GLU.h>
#include <stdio.h>
#include &...
2
votes
1
answer
670
views
OpenGL 1.1 render at fixed resolution and upscale
I'm trying to render a scene at 320x240 permanently to emulate the feel classic 240p systems, and upscale it to the full size of the screen.
The issue I have is that, although I can sort of fudge this ...
0
votes
1
answer
182
views
Can you mix shader and non shader code in opengl?
I'm currently trying to implement a minimap (basically just colored pixels next to each other) with the LWJGL opengl library.
So I have the problem when I try to use glBegin(GL_POINTS);
for the ...
0
votes
1
answer
155
views
Is it possible to use glScalef on a bitmap that is drawn with glBitmap?
I'm making a text renderer that uses FreeType 2 and legacy OpenGL. Problem is, FreeType 2's coordinate system has (0, 0) in the top left corner while OpenGL's coordinate system is Cartesian. This ...
0
votes
0
answers
217
views
Adding a shadow map to a closed source single pass fixed function pipeline OpenGL 1.x game
I've been hacking a very old fixed function pipeline OpenGL 1.x game. I've been intercepting opengl calls and injecting all sorts of modern opengl elements, such that I've achieved new lighting and ...
0
votes
1
answer
101
views
Vertex object doesn't show up (legacy OpenGL 1.2)
So I got the OpenGL Redbook 3e and am currently on chapter 2 (newer OpenGL seems too difficult for beginners to graphics programming). I copied a code snippet from the book (I added the initialization ...
1
vote
1
answer
268
views
GLFW3/GLU 3D world space using static pipeline
In previous projects, I enabled depth testing used gluPerspective called once on startup to set up a 3D space. Currently, I am rendering a square between -0.5 and 0.5 with 0.0 as its origin after the ...
2
votes
0
answers
80
views
Restoring the last texture state in legacy OpenGL 1.x
I would like to remember a current texture state in OpenGL 1.x and later restore it. I can use glIsEnabled to check which texture types are active.
Does it make sense to have enabled more than one ...
0
votes
2
answers
483
views
Multiple spotlights in opengl doesn't work
I'm using opengl for educational purposes, but I'm having trouble creating multiple spotlights to represent street lamps. I use an iterator to create several however in the end only the last spotlight ...
0
votes
2
answers
2k
views
glColor3f in OpenGl have little brightness
I have a problem with my code in OpenGl
I need to do a game engine.
I use freeglut library.
I did this practise with old Visual Studio versions and I don't have this problem. But with the Visual ...
16
votes
1
answer
12k
views
Dashed line in OpenGL3?
I'm currently porting an old OpenGL 1.1 application which makes use of wireframe models to OpenGL 3.0.
In 1.1 following code is used to create a dashed line:
glPushAttrib(GL_ENABLE_BIT);
...
3
votes
1
answer
3k
views
Minecraft transparent render hides blocks
I'm lost why does my texture renders as expected when I look it from south or east but hides the objects behind them when looking from north or west.
I have an invisible block that renders multiple ...
1
vote
1
answer
409
views
How to use the ambient color of the material instead of the global ambient color of lights? (OpenGL 1)
I'm writting the lighting effect of my programming in OpenGL 1.1. The light and normals stuffs works. I have only a wrong color
I would like to use the ambient color of the used material but not the ...
0
votes
0
answers
241
views
OpenGL 1.1 scene coordinates to screen coordinates
I know OpenGL 1.x is more than only outdated but due to the required target hardware which lacks better OpenGL drivers, I'm bound to this kind of legacy code. Or in other words: people pay for support ...
0
votes
1
answer
2k
views
Points are not drawn
First of all: yes, I know this is a really outdated programming interface. But some target machines don't even guarantee OpenGL 2.1, that's why it still has to be used.
My problem: when drawing some ...
0
votes
1
answer
357
views
How to move one object from another class with keyboard in OpenGL?
How can I to move from keyboard my Sphere in OpenGL if my Sphere is one class?
main:
#include "glos.h"
#include <gl.h>
#include <glu.h>
#include <glut.h>
#include <glaux.h>
#...
1
vote
1
answer
115
views
OpenGL GlOrtho no primitives appearing
I am drawing on a texture and then rendering this texture to the screen using GL_QUADS. There is no problem drawing the texture on screen, but while drawing to the texture the only operation that has ...
2
votes
1
answer
216
views
Low OpenGL alpha values cropping
I've injected a DLL into a game process to make a overlay interface, but the problem is that alpha values are being "cropped" (not rendering at all)
I've tested several alpha values and it seems to ...
8
votes
2
answers
19k
views
OpenGL: What does glRotatef rotate?
When I call the glRotatef like this:
glRotatef(angle,0.0,1.0,0.0) //rotate about y-axis
I know it is to rotate by angle degrees about the y axis.
But, what is being rotated here? Which object ...
-1
votes
1
answer
677
views
How to calculate the optimal glyph bounds in a character map for OpenGL text rendering
To render text with OpenGL I take the textured quad approach, I draw a quad for every character that needs to be represented. I store all the character texture information in a single texture, and use ...
10
votes
2
answers
25k
views
the difference between glOrtho and glViewPort in openGL [duplicate]
I am struggling to figure out something let's say im rendering some image that has a height of 100 and a width of 100.
In scenario A
I am taking a glOrtho(0,100,0,100,-100,100) and glViewPort(0,0,50,...
0
votes
1
answer
2k
views
How can I specify vertices in pixels in OpenGL?
I want to write a small project with OpenGL C++ and I want to use pixel instead of float value, for example like that:
glVertext2f(420, 300);
Instead of:
glVertex2f(0.4, -0.34);
Is it possible?
0
votes
1
answer
917
views
LWJGL texture renders plain white
Heyho,
this problem is really annoying...
I'm trying create a window and load & render a texture with the LWJGL.
Window-Creation works perfect, texture should be loaded correct (tested and it ...
0
votes
3
answers
465
views
full transparent object in openGL
I need to create a completely transparent surface passing through the origin of the axes and always parallel to the screen.
I'm trying to use this code (in c++) but the result is something like 50% ...
1
vote
2
answers
828
views
glMultMatrix doesn't work inside of glBegin()
I am creating a program that allows me to plot points in 3 space, connects them using a Catmull-Rom Spline, and then draws a cylinder around the Spline. I am using GL_TRIANGLES_STRIP to connect ...
-1
votes
1
answer
724
views
OpenGL wireframe from x,y, and z text file
I have a file with 3 coordinates and I can render it as points, lines, triangles , or any primitive.
I want to construct a wireframe model of this file, what should I change or add to view it as a ...
0
votes
0
answers
677
views
How to use glOrtho2D with moving positions?
I'm trying to move the camera based on a player (simple square)'s position (x, y). The scale is relatively small and the character is 0.5f by 0.5f.
How can I focus the camera on the player's x, and y ...
0
votes
1
answer
305
views
Why is LWJGL is flickering between previous and current gameState on Windows only?
This problem only occurs in Windows. Runs fine in Linux.
I have a stack based state management system. When I switch from one state to the other, the display will flicker between the previous state ...
0
votes
1
answer
104
views
3D Lines cutting off partway through the screen
I'm making a mod where it loops through all entites and draws lines to them.
It works fine, but if an entity is out of my viewport the lines will cut off midway across the screen.
My code (for the ...
0
votes
3
answers
564
views
Clicking on a Quad and getting screen coords in opengl
Say I make a quad like so:
float botBaseY = -0.5;
glBegin(GL_QUADS); // Box
glVertex2f(-.05, botBaseY + -.05);
glVertex2f(-.05, botBaseY + .05);
glVertex2f(.05, botBaseY + .05);
...
1
vote
1
answer
4k
views
Simple Colored 3D Prism
I started learning OpenGL and I'm using it with SFML 2.1 to get window, load images, etc. But I've got a problem with simple prism. Faces are partly transparent and it looks terrible :/ I was looking ...
0
votes
1
answer
3k
views
Drawing hour marks of a clock using OpenGL
here is my code:
void drawClock(void)
{
glClearColor(1.0,1.0,1.0,1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(0.0,0.0,0.0);
for(int i=0; i<12; i++){
glRotatef(30,0,...
0
votes
0
answers
227
views
Drawing to OpenGL with vertex data from a custom class
I'm looking at the apple documentation for drawing OpenGL content to the screen, on their 'drawing to a window or view page' (linked below) they show that you can draw by placing data within the ...