I'm trying to get a model of aeroplane to fly a circular path defined by cos(x) and sin(y). I'm having a lot of trouble trying to get the aeroplane model to face in the direction of the movement of where it's going. I thought using the same approach that I do for camera where we construct a view matrix would allow me to do this since I can pass a position, direction and it'll look the correct way however, when applying this, my model seems to just rotate like its performing a roll and does not do a circular motion path. I am quite confused as to where I am going wrong. Quite new to game development and graphics and would appreciate any insight
vec3 circlepos = vec3(0,0,0);
previousPosition = position;
float x = radius * cos(angle);
float y = radius * sin(angle);
position = circlepos + vec3(x, 3000.0f, y);
direction = position - previousPosition;
direction = direction.unit();
auto rotationMatrix = Matrix::ViewMatrix(position, position + direction, vec3(0, 1, 0));
auto angularSpeed = speed / radius;
angle += angularSpeed * dt;
if(angle > 2 * M_PI)
{
angle -= 2 * M_PI;
}
if(angle < 0)
{
angle += 2 * M_PI;
}
// worldMatrix is a matrix that performs a 90 degree rotation CCW since my assets have y as forward and z as up and down so this rotation brings it back into OpenGL coordinates
auto matrix = camera_viewMatrix * Matrix::Translate(position) * worldMatrix * rotationMatrix * Matrix::Scale(vec3(scale, scale, scale));

