3D to pixels

Technical discussions
Post Reply
CodeBizzar
Posts: 2
Joined: Thu Aug 08, 2013 9:50 pm

3D to pixels

Post by CodeBizzar »

Hi all
Is there a way to convert coordinates of a 3D point to screen coordinates of its image in pixels?
Thanks

ron1234
Posts: 2
Joined: Mon Aug 05, 2013 3:24 am

Re: 3D to pixels

Post by ron1234 »

Hi CodeBizzar

ILookEx.ProjectToScreen( DIPoint pt, int pxWnd, int pyWnd)
does it for me.
To convert length from model space to size in pixels do it like (C#):
iLookEx. ProjectToScreen( new DIPoint(length, 0), pxWnd, pyWnd);
iLookEx. ProjectToScreen( new DIPoint(0, 0), pxWnd0, pyWnd0);
int lengthInPixels = pxWnd - pxWnd0;

Remember that (0, 0) 3D point does not map to (0, 0) pixel on screen. Confused me first time.
Ron

CodeBizzar
Posts: 2
Joined: Thu Aug 08, 2013 9:50 pm

Re: 3D to pixels

Post by CodeBizzar »

Thank You, Ron

Post Reply