1,397 questions
Advice
1
vote
2
replies
197
views
How do I create a raycast in C++ for a game
I have been making a 3D game from scratch using opengl and C++ and I want to know how I can make a ray casting class in C++ for my game where I can call it when ever I need to, to check for things ...
0
votes
1
answer
73
views
Matrix assignment, not conversion, between Eigen, glm and ipp libraries
When converting a matrix from one library to another, is there a way to assign the data pointers of the respective structures of matrices from Eigen, glm and ipp libraries instead of copying them ...
0
votes
0
answers
51
views
Mapping Phone Quaternion Data to Vulkan Coordinates and having Consistent Rotation Behavior
I'm working on a Vulkan project that takes my phone Quaternion data through a UDP connection, and then is used to transform the coordinates of a sword. However, the model doesn't accurately represent ...
1
vote
1
answer
130
views
Is it possible to use the GLM algebra library as a module in C++?
Is there a way a header-only library like GLM can be used as a module?
module;
#include "HeaderOnlyLibrary.h"
export module MyModule;
I know that includes have to go in the 'global module ...
1
vote
1
answer
132
views
Why fovy should be unchanged when resizing window
In GLUT we can register a callback when the viewport size is changed. And often the reshape function looks like this, which changes the perspective projection matrix.
void reshape(int width, int ...
8
votes
2
answers
277
views
How can I find the largest axis-aligned rectangle of a given aspect ratio that can fit inside a rotated rectangle?
Given a rotated rectangle, how can I find the largest axis-aligned rectangle of a given aspect ratio that can fit within the original rectangle? For example, I'd want to find the largest rectangle of ...
0
votes
1
answer
169
views
GLFW window not appearing using vs code (im in arch linux using plasma wayland)
I can see an icon in my dock (icons-only task manager) but i can't see it i can hover it and yes it's the Vulkan window.
#include <vulkan/vulkan.h>
#include <GLFW/glfw3.h>
#define ...
0
votes
1
answer
53
views
Why does glm_project return inverted screen positions when the camera rotates?
I'm using glm_project from cglm to project a 3D world position to screen space. The code mostly works, but when I rotate the camera, the projected screen position moves in the opposite direction.
Here'...
1
vote
2
answers
126
views
How to transform a world space position to a rotation based local space position [closed]
I have a world space position named P.
I want to compute its corresponding position in another space named let's say "L".
L is made of two components:
The world space position of its ...
1
vote
1
answer
364
views
Convert glm::quat to glm::vec3 of Euler angles? [duplicate]
How to convert glm::quat data to glm::vec3 angles?
Example:
I've start data:
glm::vec3 start = glm::vec3(90, 30, 45);
and after convert to quat
(0,730946)(0,016590)(0,677650)
.... How to convert ...
0
votes
1
answer
77
views
GLM_FORCE_SIMD_AVX2 doesn't seem to exist in any of the GLM source
Did GLM_FORCE_SIMD_AVX2 change to GLM_FORCE_AVX2? Because in the manual.pdf and the sources I've seen on the internet says:
#define GLM_FORCE_SIMD_AVX2
#include <glm/glm.hpp>
// If the ...
1
vote
0
answers
44
views
glm::quat-based camera behaving wierdly
I am writing a camera controller for my project and I have rewritten it many time, but for some reason every time I look up or down about 50° the camera starts rotating rapidly.
Here is my current ...
1
vote
1
answer
159
views
In OpenGL, Drawing a spinning globe using glDrawElements has weird artifacts Seems like an edge bug? How can I debug it?
I wrote a demo drawing a textured sphere using an indexed draw using triangle strip.
The indices seem correct. Given 30 points around each row:
0, 30, 1, 31, 2, 32, ... 29, 59, 0, 30
Then there are ...
0
votes
1
answer
614
views
How to build the C++ GLM library with cmake in Windows?
I am having issues building the GLM library. I am using Windows and VS Code. I have the following installed:
Mingw64 that includes gcc and g++ compilers
cmake
For GLM, as instructed in their readme:
...
0
votes
1
answer
180
views
OpenGL program is showing black screen only, while it should be showing a square
Nothing is drawn in the screen.
Only a black window is being shown and no shape or anything.
My laptop doesn't have a dedicated Graphics card, only the integrated one. But it was working fine in same ...