Questions tagged [joml]

questions related to the usage of the Java OpenGL Math Library (JOML)

13 questions
2
votes
1 answer

why the second method call crashes java?

I'm making a java 3d project with lwjgl. Java crashes when calling Sphere.getVertices() method. But when I try to detect a collision between two cubes, I see a black screen with no components, but java doesn't crash. log # # A fatal error has been…
notwhale
  • 19
  • 4
2
votes
2 answers

Why is my 3D cube distorting when rotating?

The problem is that when rotating my 3D cube on more than one axes, it distorts weirdly roughly halfway through. I am using the JOML math library for matrices. // This is the model matrix for the rotation of a textured cube Matrix4f model = new…
1
vote
1 answer

LWJGL Projection Matrix not working (Quad remains the same even after multiplying with Projection Matrix)

I programmed a LWJGL 3 code to render a quad on the screen. I even added the projection Matrix to it, still I don't see any changes in the appearance of the quad. If I change the FOV of the frustum the quad gets smaller (that's what I expected) but…
1
vote
1 answer

Loss of 3D projection when migrating from LWJGL 2 to LWJGL 3 with JOML

I have a small project, which was written with LWJGL 2 and wanted now to move to version 3. I changed the main lib without bigger problems. But in small steps. So I first didn't do a change to the Vector and Matrix classes. Instead, in the new…
1
vote
1 answer

(LWJGL 3.2.3) build.gradle won't build when implementing LWJGL components

Can someone help me? My "build.gradle" won't build when implementing LWJGL and JOML. Here's my build.gradle: project.ext.lwjglVersion = "3.2.3" project.ext.jomlVersion = "1.10.2" project.ext.lwjglNatives = "natives-windows" repositories { …
ItsNova
  • 23
  • 7
1
vote
2 answers

What is the correct way to rotate a quaternion from its current rotation a certain angle?

I am trying to use quaternion rotation using the quaternion from JOML: https://github.com/JOML-CI/JOML/blob/main/src/org/joml/Quaternionf.java. I can get objects to rotate but they get stuck and are unable to complete a full rotation. The object is…
Althaen
  • 47
  • 10
1
vote
1 answer

I use LWJGL and the JOML library, but when I multiply matrices it doesn't work

I start learning LWJGL very recently and I am trying to get a simple shader to work. I followed an "old" tutorial but when I run the code no shapes appear (the window open but it is just black). Here is my .vs file for my shader : #version…
Secu7or
  • 45
  • 7
0
votes
1 answer

Java: Setting Quaternionf towards a specific position

I have a problem. I have created an object that will move in X, Y, Z axes in changing directions. I want to use the Quaternionf class as my tool. Knowing the X, Y, Z coordinates of the object and the coordinates of the target point, I want to set…
Adixe
  • 119
  • 7
0
votes
0 answers

JOML : Perspective Matrix doesnot retain shape

Im trying to make my own 3D engine using LWJGL. This is the Line of Code which creates the projection matrix for the uniform to pass. pMatrix = new Matrix4f().ortho(-2f, 2f, -1.125f, 1.125f, 0.1f, 1000f); Perfectly working Orthographic…
0
votes
1 answer

Oriented projectiles keep facing camera

I'm trying to render a 2d image that represent a projectile in a 3d world and i have difficulty to make the projectile face the camera without changing its direction. Im using JOML math library. my working code to orient the projectile in his…
Joezzz
  • 79
  • 9
0
votes
1 answer

Movement using quaternion

I'm creating a first-person camera that rotates using Euler angles. I created the view matrix for the camera like this: Quaternionf rotation = new Quaternionf().rotateXYZ( orientation.x, orientation.y, orientation.z ); return new…
Johannes
  • 377
  • 1
  • 5
  • 16
0
votes
1 answer

Object is rotating weidly when using JOML

I am trying to create a 3D engine using LWJGL3 and i keep getting this issue: When rotating an object it does this: The quad SHOULD be in the middle, as i didn't change the x coordinate, but it isn't. I actually tried to redo the transformation…
Javmas12
  • 23
  • 4
0
votes
1 answer

How to rotateX or rotateZ view matrix around specified axis?

I would like to rotate view matrix (I supposed to think this represents camera position). I already rotate view matrix about Y-axis by using Matrix4f#rotateY successfully. However, about rotateX this requires the target position at (0,0,0) center of…
hiropon
  • 1,675
  • 2
  • 18
  • 41