Hi all
Is there a way to convert coordinates of a 3D point to screen coordinates of its image in pixels?
Thanks
3D to pixels
Re: 3D to pixels
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
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