again->converting from screen to world space

i have a rectangle that moves across the screen, i tried to connect the top-left corner of the rectangle to the line…i assumed that only thing i need to do is to convert screen to world space and use it to render line.

here is what i tried:

    function OnPostRender(){
    
    		CreateLineMaterial(); 
    		lineMaterial.SetPass(0); 
    			
    		GL.Begin(GL.LINES); 
    		GL.Color(Color(1,1,1,1));
    		GL.Vertex3(0,0,0);
            GL.Vertex3(cam.ScreenToWorldPoint(Vector3(Label.rPosX,Label.rPosY,0)).x,-cam.ScreenToWorldPoint(Vector3(Label.rPosX,Label.rPosY,0)).y,cam.nearClipPlane); 
    		GL.End();	
    	
    		
    }//END OF ONPOSTRENDER

so coords of the rect are Label.rPosX and Label.rPosY (they are inside class Label)
the line should go from origin to the projected screen coords into world space. line renders but it is not connected to the rectangle and it goes all over the place when
rectangle moves…

am i doing this right? any ideas?

i was searching through forums and i found that the third parametar is the distance from the camera so i modified a part of teh OnPostRender a bit

			var distanceCamera : float= camScript.currentTarget.position.z-cam.transform.position.z;
			var screenPoint=Vector3(Label.rPosX,Label.rPosY,distanceCamera);
			
			var worldPoint=cam.ScreenToWorldPoint(screenPoint);
			
			GL.Begin(GL.LINES); 
			GL.Color(Color(1,1,1,1));
			GL.Vertex3(0,0,0);
			GL.Vertex3(worldPoint.x,worldPoint.y,worldPoint.z); 
			GL.End();

but still it doesnt work, i am not sure could this be done this way or not??