And i dont think i want an Arcball Camera, im sorry, i might have spoken too wierd
What i want the Camera to do is to follow around the Player in every Movement.
The Player moves like a FreeCamera and the Camera follows behind.
What i dont want is to just move the Camera in the Function i call the Playermovement, i want the camera to move BASED on the players position and Rotation.
And that works just fine, at least for the Rotation. Just the Translation doesnt want to work.
GIF of Movement Example
As you see in the Gif, its all working, but the Camera class is not moving.
Or to be precise, it is moving but its being reset everytime, which makes this wobbling and glitching kinda thing.
As i mentioned earlier, i tried a translation of just 1,1,1 and it was doing this glitching back and forth the whole time.
I dont know why it is not translating the Cameras position.
I checked the Values i give into the translation, i even checked if that changes the position i get with your method and the Position doesnt seem to change.
For Position.Z for example it just takes the Value of the Differential Change.
The System.out.print for position.z looks like this:
Looks pretty much just like
dt * player.linearVel.x
Here is my viewMatrix:
public void move(double delta)
float dt = (float)delta;
this.angularVel.x = player.angularVel.x;
this.angularVel.y = -player.angularVel.y;
this.angularVel.z = player.angularVel.z;
this.Rotation.x += dt*angularVel.x;
this.Rotation.y += dt*angularVel.y;
this.Rotation.z += dt*angularVel.z;
linearVel.x = dt * player.linearVel.x;
linearVel.y = dt * player.linearVel.y;
linearVel.z = dt * player.linearVel.z;
viewMatrix.getTranslation(position); // <- store entity's position
And BTW, is there a way to do
With the Entities or cameras Rotation too?