1,384
questions
-1
votes
0
answers
8
views
Missing triangles when rendering obj file with assimp
I'm using assimp and opengl to render a simple OBJ file, but when it is rendered the figure contains triangles with wrong coordinates (or at least that's what I think. It's possible that some ...
-3
votes
0
answers
63
views
Render a line in OpenGL as a quad using Geometry shader [closed]
I have a simple class for drawing OpenGLLine. It works great using just vertex and fragment shader. But now I want to make the line thicker and for that I decided to use Geometry shader. But for some ...
-1
votes
0
answers
28
views
Framebuffer appears to be black when using color_attachment texture [closed]
I recently implemented a framebuffer, because i want to render inside imgui, but when i actually pass the color_attachment to imgui it renders a black texture, i debugged the framebuffer, it receives ...
4
votes
1
answer
65
views
How do I convert a Quaternion to Euler using glm and C++?
In my project, I use quaternions in my code, but I also want to be able to use Euler angles in other parts in my code because it's easier for me to use. But when I rotate the Y axis of a glm::...
-1
votes
1
answer
34
views
How to calculate local axes?
I have a Trasnform class, it has as princiapli attributes of glm::vec3 that describe the position, rotation and scale, through the apply() method the transformation matrix is calculated and from this ...
2
votes
0
answers
56
views
glm::angleAxis function equivalent in cglm on C?
i'm trying to make a camera on C with cglm by a tutorial that uses glm. it uses glm::angleAxis to get rotation quaternions from pitch and yaw. i was searching if cglm have equivalent to this function, ...
0
votes
1
answer
117
views
glReadPixels() returns background color?
I am trying to get the colour which was clicked on in OpenGL via glReadPixels():
#include <iostream>
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <glm/gtc/...
-2
votes
1
answer
60
views
Characters centering weirdly in Freetype, OpenGL [closed]
I am trying to render some text inside a button (which is just a vec2 of button size and vec2 of button position), and I am trying to center the text inside the button. and it works for characters ...
-2
votes
1
answer
46
views
How glm::translate works?
While debugging a videogame in OpenGl C++ I printed the transformation/translate matrix and show me something like this:
1 0 0 0
0 1 0 0
0 0 1 0
tx ty tz 1
but I think it should be:
1 0 0 tx
...
1
vote
1
answer
49
views
Why is my 2d quad not rendering using glm::perspective?
I try to render a simple 2d quad using DirectX12, but somehow my perspective camera is not displaying the quad, orthographic camera works though. The reason of the perspective camera is to prepare for ...
0
votes
0
answers
50
views
How to Maintain Image Aspect Ratio When Tiling and Using a Camera in OpenGL?
I am working on rendering a large image in tiles using OpenGL. My goal is to render images in tiles, but i am struggling maintain the aspect ratio of the original image when applying a camera ...
-2
votes
1
answer
52
views
How do I get world coordinates from mouse coordinates in OpenGL with Camera class?
I am trying to convert mouse coordinates to world coordinates in OpenGL and I am using the camera class from learnOpenGL.com, which is this. And I'm using this function for converting cursor space to ...
1
vote
0
answers
27
views
Camera movement on opengl project: sideways movement rotates and skews image
im trying to make a simple triangle mesh and look at it with a camera. The mesh should be in the x/y plane with z = 0, while the camera should be at the same plane but z = 10. The project is in this ...
0
votes
0
answers
27
views
How to know the existing pixel value of the framebuffer [duplicate]
I am trying to make a heatmap and in my Fragment shader i want to know the existing color value of the pixel on which the shader will write.
Based on the red color value i want to decide whether to ...
-1
votes
1
answer
35
views
How to translate point light and rotate directional light OpenGL?
I intend to implement Gouraud shading with two light.(point light and directional light)
I want to translate the point light and rotate the directional light with keyboard callback function of OpenGL.
...