-2

i have implemented aeroplane movement in opengl but when i kept camera on aeroplane head and looking at yawaxis its giving shaking world

eye = glm::vec3(
    ball1.position.x + 25.0f * ball1.roll_axis.x+ball1.yaw_axis.x,
    ball1.position.y + 25.0f * ball1.roll_axis.y+ball1.yaw_axis.y,
    ball1.position.z + 25.0f * ball1.roll_axis.z+ball1.yaw_axis.z); 
target = glm::vec3(
    ball1.position.x + 60.0f * ball1.roll_axis.x+ball1.yaw_axis.x,
    ball1.position.y + 60.0f * ball1.roll_axis.y+ball1.yaw_axis.y,
    ball1.position.z + 60.0f * ball1.roll_axis.z+ball1.yaw_axis.z);
up = ball1.yaw_axis;

aeroplane movement is correct

genpfault
  • 51,148
  • 11
  • 85
  • 139
daya
  • 9
  • 3

1 Answers1

0

It could be caused by gimbal lock. Check out accumulative matrix transformations or, if You are using GLM eulerAngleYXZ.

krawacik3
  • 79
  • 1
  • 4