Project world position to screen coordinate system

related question: how about when you change the viewport as well? cause it doesn’t seem to work as expected if you set the viewport!
here the screenshots: