Hello Guest

Recent Posts

Pages: [1] 2 3 ... 10
1
Read this: https://github.com/JOML-CI/JOML/wiki/Common-Pitfalls#angles-are-always-in-radians

Currently, you are passing 90 radians to Matrix4f.perspective()

made these getters and replaced camera.Zoom with camera.getZoom
i also replaced other things where necessary which is really only this:
Code: [Select]
front.x = (Math.cos(getYaw()) * Math.cos(getPitch()));
front.y = Math.sin(getPitch());
front.z = (Math.sin(getYaw()) * Math.cos(getPitch()));

It was an improvement of the white pixels being shown roughly 3 seconds instead of 1
video:https://drive.google.com/file/d/1xMTHa97qqNcODF4NdxA5TgCmpp7jMYSi/view?usp=sharing
so that wasnt the entire solution
2
Read this: https://github.com/JOML-CI/JOML/wiki/Common-Pitfalls#angles-are-always-in-radians

Currently, you are passing 90 radians to Matrix4f.perspective()
3
Camera:https://pastebin.com/Vb1xFir6
Main:https://pastebin.com/wMchBSbV
shaders:https://pastebin.com/UmQyRFNs

The problem is that i should see a model of a dragon befor i added the camera that worked about fine.
now i can only see some white pixels that disapear really fast even when i keep setting the position of the camera to 0 -3 0
this means that something is wrong with my rendering.
I would appreciate some help
4
Lightweight Java Gaming Library / Re: Why do all my Vectors get messed up
« Last post by coolian on September 20, 2020, 14:52:09 »
nvm there isnt
5
Lightweight Java Gaming Library / Re: Why do all my Vectors get messed up
« Last post by coolian on September 20, 2020, 14:47:01 »
somewhere in here https://pastebin.com/Vb1xFir6
is still an error but it propably is'nt related to this question.
6
Lightweight Java Gaming Library / Re: Why do all my Vectors get messed up
« Last post by KaiHH on September 20, 2020, 12:39:55 »
Code: [Select]
Matrix4f viewMatrix = new Matrix4f();
Vector3f pos = Position;
Vector3f up = Up;
Vector3f front = Front;
viewMatrix = viewMatrix.lookAt(pos, pos.add(front), up);
that is done because im pretty sure doing
Code: [Select]
viewMareiy.lookAt(Position, Position.add(Front), Up);would change the Position vector which for creating the view matrix i obviously dont want.
There is absolutely zero difference between your first code and the second line... You just assign the same instance to new local variables, that still point to the same object instance.
Therefore, you still modify the vector stored in Position/pos. You can do something like:
Code: [Select]
viewMareiy.lookAt(Position, Position.add(Front, new Vector3f()), Up);
in order to store the addition result in a new vector object.

Also, please read this first: https://github.com/JOML-CI/JOML/wiki/Common-Pitfalls#methods-without-a-dest-parameter-modify-this-and-return-this
7
Lightweight Java Gaming Library / Re: Why do all my Vectors get messed up
« Last post by coolian on September 20, 2020, 11:50:15 »
Ok i just gotta not do Math.toRadians();
8
Lightweight Java Gaming Library / Re: Why do all my Vectors get messed up
« Last post by coolian on September 20, 2020, 11:44:42 »
Code: [Select]
front.x = (float) (Math.cos(Math.toRadians(Yaw)) * Math.cos(Math.toRadians(Pitch)));
front.y = (float) Math.sin(Math.toRadians(Pitch));
front.z = (float) (Math.sin(Math.toRadians(Yaw)) * Math.cos(Math.toRadians(Pitch)));
Front = front.normalize(Front);
those calculations are the problem it seems they mess up x
9
Lightweight Java Gaming Library / Re: Why do all my Vectors get messed up
« Last post by coolian on September 20, 2020, 11:37:38 »
The FRONT Constant gets messed up but idk where because its not when it gets created
10
Lightweight Java Gaming Library / Why do all my Vectors get messed up
« Last post by coolian on September 19, 2020, 23:41:16 »
I have  a Camera class:https://pastebin.com/ykmAj8zv
and the xyz components of the Vectors from joml get set to nan for some reason in any other class the only thing hats being done to it is telling the camera to process keypresses mousescroll and mouse position data aswell as getting the view matrix, getting the zoom and creating it
the reason things like
Code: [Select]
Matrix4f viewMatrix = new Matrix4f();
Vector3f pos = Position;
Vector3f up = Up;
Vector3f front = Front;
viewMatrix = viewMatrix.lookAt(pos, pos.add(front), up);
that is done because im pretty sure doing
Code: [Select]
viewMareiy.lookAt(Position, Position.add(Front), Up);would change the Position vector which for creating the view matrix i obviously dont want.
Why do all the Vectors get messed up.
Pages: [1] 2 3 ... 10