How can I animate the camera rotation on x axis?

Hello everyone

I would like to make an animation for rotating the camera in X axis to move and stop at the location Math.PI/2 ,
and for this I write the following code:

   let camerax;
      scene.registerBeforeRender(() => {
       else if (camera.position.y >= 1500 && camera.inputs.attached.mouse ){
        camerax = camera.rotation.x
        if (sin(camerax) !== 1) {
            do {
                camerax += Math.PI/360
            while (sin(camerax) === 1)

but it did not work, is it possible to give me some hint to do it?

here is my PG:

Thank you so much, I forgot to use Math.sin() , but now I think there are some problem with my code, because when I go over 1500 in Y axis the camera didn’t rotate to Math.PI/2

Thank you so much , thanks for your recommend :pray: :pray: :pray: I am going to use it to solve my problem.

1 Like