i am trying to figure out the projection from world to viewport or screen…but no results. i want to render simple white line from one point to another but projected on the screen…i get 3d line which isnt what i want. can somebody look at the code i have and let me know what is wrong with it. thanks!
function OnPostRender(){
origin=cam.camera.WorldToViewportPoint(SceneControl.ReturnCameraTargetTransform().position);
Debug.Log(origin.ToString());
CreateLineMaterial();
lineMaterial.SetPass(0);
GL.Begin(GL.LINES);
GL.Color(Color(1,1,1,1));
GL.Vertex3(origin.x ,origin.y, 0);
GL.Vertex3(origin.x+0.1 ,origin.y+0.1,0);
GL.End();
}