Thanks Omega! I've already implemented the roll view, but I'm still testing it. It's not stable and has strange behaviour in some cases. My implementation is almost the same like yours. But I don't the use the zoom right now. In spite of this I create a "Look-At" view transform looking towards the center of Earth.
To be accurate, we should rename roll to tilt, cause the roll is defined as the step value of the tilt. Like the yaw is the step value of heading.
One more thing - I saw that your roll is arround the Z axis, but the heading too. Is this correct?
Best wishes!
Code:
// Construct the model-view transform matrix for the specified coordinates. // Because this is a model-view transform, matrices are applied in reverse order. Matrix transform = Matrix.IDENTITY; // Pitch, roll, heading transform = transform.multiply(Matrix.fromRotationX(pitch.multiply(-1))); transform = transform.multiply(Matrix.fromRotationY(roll.multiply(-1))); transform = transform.multiply(Matrix.fromRotationZ(heading)); Vec4 eyePoint = globe.computePointFromPosition(position); Vec4 up = globe.computeNorthPointingTangentAtLocation(position.getLatitude(), position.getLongitude()); Vec4 lookAtPoint = eyePoint.subtract3(globe.computeSurfaceNormalAtPoint(eyePoint)); transform = transform.multiply(Matrix.fromViewLookAt(eyePoint, lookAtPoint, up));
One more thing - I saw that your roll is arround the Z axis, but the heading too. Is this correct?
Best wishes!
Comment