code: def draw360_to_texture(self, cubetexture, **kwargs):
          
  
          assert self.camera.projection.aspect == 1. and self.camera.projection.fov_y == 90  # todo: fix aspect property, which currently reads from viewport.
          if not isinstance(cubetexture, TextureCube):
              raise ValueError("Must render to TextureCube")
  
          # for face, rotation in enumerate([[180, 90, 0], [180, -90, 0], [90, 0, 0], [-90, 0, 0], [180, 0, 0], [0, 0, 180]]):
          old_rotation = self.camera.rotation
          self.camera.rotation = self.camera.rotation.to_euler(units='deg')
          for face, rotation in enumerate([[180, -90, 0], [180, 90, 0], [90, 0, 0], [-90, 0, 0], [180, 0, 0], [0, 0, 180]]):  #first 2 switched
              self.camera.rotation.xyz = rotation
              cubetexture.attach_to_fbo(face)
              self.draw(**kwargs)
          self.camera.rotation = old_rotation
docs: Draw each visible mesh in the scene from the perspective of the scene's camera and lit by its light, and
          applies it to each face of cubetexture, which should be currently bound to an FBO.