Category : 3d

I try to implement a quaternion-based camera rotating like FPS game controlled by mouse movement, but can move freely. The coordinate system of camera space: Forwad vector: -z-axis Up vector: +y-axis The code of constructing camera space: mPosition = glm::vec3(0.0f, 0.0f, 2.0f) mForward = glm::normalize(glm::vec3(0.0f, 0.0f, 0.0f) – mPosition); mUp = glm::vec3(0.0f, 1.0f, 0.0f); mCameraRotation ..

Read more

I have this code snippet that should – at last in my mind rotate the billboarded object around its Z-axis (objectLookAt) to align it with camera’s right vector (cameraRight). To do this I try to get angle between the object’s right vector and camera’s right vector and then rotating around objects lookAt vector (objects Z ..

Read more

I am rendering a 3d model with OpenGL, and when I render in debug mode it looks fine, but when I switch to release mode the vertices mess up. here is my code model class: https://pastebin.pl/view/0ca03509 mesh class: https://pastebin.pl/view/8508395c main cpp file: https://pastebin.pl/view/972d0b9e Debug mode screenshot: https://i.imgur.com/QiCp0Eu.png Release mode screenshot: https://i.imgur.com/0UcnKvR.png please help Source: Windows ..

Read more

The problem is : given 2 known 3D points (A and B), forming a ray R find the Z coordinate of C that is lying on R, but only knowing X and Y… Sounds easy at first, but now I am lost… Help appreciated Source: Windows Que..

Read more