Relative Content

Tag Archive for c++opengl

Calculating graph size in OpenGL using screen dimensions

I need help calculating the size of my graph based on screen dimensions in my OpenGL project. I’ve tried subtracting start and end points from screen coordinates, but I’m not sure if it’s correct. Can anyone help with a visual representation or explanation? I’ve drawn the X and Y axes using the following code snippet.

Calculating graph size in OpenGL using screen dimensions

I need help calculating the size of my graph based on screen dimensions in my OpenGL project. I’ve tried subtracting start and end points from screen coordinates, but I’m not sure if it’s correct. Can anyone help with a visual representation or explanation? I’ve drawn the X and Y axes using the following code snippet.

Exception thrown at 0x09D7FEE9

Exception is thrown at 0x09D7FEE9 in 7-1_FinalProjectMilestones.exe: 0xC0000005: Access violation reading location 0x0E065000. i keep getting this error, I have checked the directory and such. still issue persists

OpenGL no lights, black window

I’m trying to do an assignment for college and I don’t know why it shows me a black window below, I send the Program, fragment_shader and vertex_shader, when I change the background color to, for example, gray, my object is shown as black, as if light did not exist, these are my tasks that I have to do, obj rendered correctly:

OpenGL using vao to draw

I am a new learner in OpenGL. I am learning VAO and VBO to draw a simple triangle right now. I follow the video and write the code to generate and validate VAO and VBO like this
`void CreateTriangle()
{
GLfloat vertices[] = {
-1.0f, -1.0f, 0.0f,
1.0f, -1.0f, 0.0f,
0.0f, 1.0f, 0.0f
};

Difference between C++ and OpenGL objects

unsigned int VBO; glGenBuffers(1, &VBO); glBindBuffer(GL_ARRAY_BUFFER, VBO); glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); I thought objects are created by ClassName objectName. I’ve failed to wrap my head around this one c++ opengl 4 The term “object” is highly abstract and is not tied to anything in particular. In programming objects come in many forms and an OpenGL […]