i am just starting with simple OpenGL/GLSL programming and running into a mistake. I want to build a struct for my data that i use. I would like to save parts of it in vec3 or vec4 etc. But i always get the Error vec3/vec2 not defined.
What am i…
When trying to render my opengl texture I just get a solid quad that is the base color of my texture.
Here is my code for loading textures and renderering / my shaders
vertexShader.vert
#version 400 core
in vec3 in_Position;
in vec3 in_Color;
in…
I've a problem with my clock. In the first 10 minutes the hour hand doesn't show the correct hour and it changes when the minute hand's change but after 10 minutes it shows correctly. Could you please help me to fix it?
I think there is a problem in…
I am new to OpenGL. I have the following code that I am using from a tutorial I followed, what it does is render a tile map. It does this successfully but my problem now is that I want to add a moveable object onto the window however it is not…
I am building an application that uses freeglut, in windows 32bit, debug mode. I have linked the static debug freeglut lib.
To fix linkage errors, as mentioned here:
freeglut error LNK1104
I have added:
#define FREEGLUT_STATIC
#define _LIB
#define…
My program refuses to do depth testing. The two sphere objects are always drawn in the order they are created, not according to their position. Sphere alpha is positioned at (0, 0, 1) and Sphere beta is positioned (0, 0, -10), yet OpenGL still draws…
A program crashes if I try to use ifstream while having OpenGL/freeglut. My code:
#include
#include
#include
double x, y;
std::ifstream read("coordinates.txt");
void display() {
glBegin(GL_LINE_STRIP);
…
Hey I can't get my texture to show up and I have no idea what's wrong. Tutorials haven't helped. Here's my code:
Player p();
//The glutDisplayFunc();
void display() {
glPushMatrix();
glClear(GL_COLOR_BUFFER_BIT |…
I wrote this code to animate the Lorenz attractor:
#include
#include
double x = 1, y = 1, z = 1, a = 10, b = 28, c = 8/3, precision = 0.000001, lastx = x, lasty = y, lastz = z;
int counter = 0;
void draw() {
…
I want to create a window covering my whole desktop screen with displaying colors RGB and then VIBGYOR. The color delay should be 1 second.
This is the code I have written but output is not as expected. Can anyone tell me where I am…
I'm trying to compile the freeglut utilities from http://freeglut.sourceforge.net/docs/install.php Compiling instructions are not provided for Visual Studio 2013 and I don't see any solution file, nor a visual studio folder.
How to get a 3d tetrahedron (ie 3-sided pyramid) rendered with glBegin(GL_TRIANGLES) to face a point.
I need the correct formula so that I can use glRotatef() to rotate my object in the x, y, and z coordinates so that it faces a point (x2, y2, z2).…
My issue is that my function does the job so quickly that i don't see the progress in the screen, here is my display function:
void showMaze(const Maze::Maze &m){
glPushMatrix();
glTranslatef(-1,1, 0);
for(int i=0;i
My experience with openGL is not great so some of this may seem sloppy to you, but I have a project where I use opengl to render an object in using my own shaders. I then should be able to free roam with the camera around the object using my mouse…