TransformControls on my scene normally works but after I render camera on useFrame hook, TransformControls gizmos become offsetted as you can see in the video. All mouse clicks are offseted.
useFrame(({camera, gl, scene}) => {
gl.autoClear = false;
// Render main camera
gl.setViewport(0, 0, window.innerWidth, window.innerHeight);
gl.setScissor(0, 0, window.innerWidth, window.innerHeight);
gl.setScissorTest(true);
gl.clear(true, true, true);
gl.render(scene, camera);
})
if I comment this out and let r3f render the scene everything is working fine. I thought that maybe I am not updating projection matrix or something like that but couldn’t figure it out.