š“pothicon
š“pothicon
Explore posts from servers
JCHJava Community | Help. Code. Learn.
Created by š“pothicon on 11/11/2024 in #java-help
Removing roll from camera matrix
I have a camera class which is just this:
import org.joml.*;

public class Camera {
public Matrix4f viewMatrix = new Matrix4f().setTranslation(new Vector3f(100, 200, 100));

public void rotate(float x, float y) {
viewMatrix.rotateXYZ(x, y, 0);
}
public void move(float x, float y, float z) {
viewMatrix.translate(x, y, z);
}
}
import org.joml.*;

public class Camera {
public Matrix4f viewMatrix = new Matrix4f().setTranslation(new Vector3f(100, 200, 100));

public void rotate(float x, float y) {
viewMatrix.rotateXYZ(x, y, 0);
}
public void move(float x, float y, float z) {
viewMatrix.translate(x, y, z);
}
}
and it works, but I want to eliminate the roll from the matrix somehow.
23 replies
JCHJava Community | Help. Code. Learn.
Created by š“pothicon on 10/27/2024 in #java-help
Figuring out path to resources in built jar
Im currently doing this to read my shader files:
Utils.readFile("src/main/resources/assets/base/shaders/scene.vert")
Utils.readFile("src/main/resources/assets/base/shaders/scene.vert")
and it works when just testing in intellij, but if i build the jar it no longer works as the src/main/resources part of the path doesnt exist. Any solutions?
11 replies
JCHJava Community | Help. Code. Learn.
Created by š“pothicon on 8/2/2024 in #java-help
Repositioning objects to stay in the same position relative to each other when rotated.
No description
10 replies
JCHJava Community | Help. Code. Learn.
Created by š“pothicon on 6/14/2024 in #java-help
Implementing Desmos Function into Java
No description
78 replies
JCHJava Community | Help. Code. Learn.
Created by š“pothicon on 3/9/2024 in #java-help
Get progress of int between two other ints.
I have three integers, min, max, and value. Value is always between min and max, but I need to figure out how to get a double that represents how "far along" the value is from min to max. For example: Min: 0 Max: 100 Value: 69 would return 0.69 as it is 69% between 0 and 100.
I just need help on the math required for this.
6 replies
JCHJava Community | Help. Code. Learn.
Created by š“pothicon on 1/7/2024 in #java-help
Unable to get list of list.
No description
56 replies