We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

How can camera go back to its original matrix including position and rotation

Home Forums Programming How can camera go back to its original matrix including position and rotation

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #35056
    derekwang0605
    Customer

    I tried to setup the camera back to the original position after all the animations by below, but did not work. Camx/y/z are the position variables I saved from the beginning.
    var camera = app.camera;
    var camx=camera.position.x;
    var camy=camera.position.y;
    var camz=camera.position.z;
    var camrx=camera.rotation.x;
    var camry=camera.rotation.y;
    var camrz=camera.rotation.z;
    ”’
    animation code here
    ”’
    camera.position.x=camx;
    camera.position.y=camy;
    camera.position.z=camz;
    camera.rotation.x=camrx;
    camera.rotation.y=camry;
    camera.rotation.z=camrz;
    camera.update();
    camera.updateProjectionMatrix();

    #35108

    Hi,

    Can you create a sample project that reproduces this issue?

    Chief 3D Verger | LinkedIn | Twitter

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.