DG Kernel Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
Overview of the software
What is new
Licensing
Collapse ModelsModels
Collapse DG Kernel ComponentsDG Kernel Components
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Collapse General GeometryGeneral Geometry
Collapse ModelModel
Collapse ViewView
Collapse General ComputingGeneral Computing
Collapse Samples and TutorialsSamples and Tutorials
Collapse GraphicsGraphics
Collapse Math ObjectsMath Objects
Collapse DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation Links Search Documentation


ILookEx Interface

ScreenTo3D
ProjectToScreen
ScreenTo3DEx
ScreenToEyeFrame

This interface allows mapping between the screen coordinates and 3D global coordinates of the correspondent point on the Viewing Plane

ILookEx can be queried from the correspondent IView interface.

See also Interface List


HRESULT ScreenTo3D( int xWnd, int yWnd, DIPoint *pPt )

Parameters

xWnd, yWnd- [in] - coordinates of the point in pixels relative to the upper left corner of the display window.

pPt - [out] - Correspondent 3D point on the Viewing Plane. Coordinates of pPt are relative the global frame.

Returns

S_OK in case of success.
Remarks:

This method allows mapping between the screen coordinates and 3D global coordinates of the correspondent point on the Viewing Plane. Coordinates of pPt are relative to the global frame. Normally xWnd, yWnd are coordinates of a point in pixels, which are supplied in a handler for a windows mouse action message like mouse down, mouse move, or mouse up messages.


HRESULT ProjectToScreen( DIPoint pt, int *pxWnd, int *pyWnd)

Parameters

pt - [in] 3D point in global coordinates.

pxWnd, pyWnd - [out] - mapped window coordinates in pixels of projection of pt to the Viewing Plane.

Return Values

S_OK in case of success.
Remarks:

For any 3D point pt in space the method will find projection if pt to the Viewing Plane and will return windows coordinates of its mapping to the computer screen.


HRESULT ScreenTo3DEx( int xWnd, int yWnd, double dist, DIPoint *pPt )

Parameters

xWnd, yWnd- [in] - coordinates of the point in pixels relative to the upper left corner of the display window.

pPt - [out] - Correspondent 3D point. Coordinates of pPt are relative the global frame.

dist - [in] Required distance from the Viewing Plane.

Returns

S_OK in case of success.
Remarks:

This method calculates point in 3D space, which is translation of point identical to one returned by ScreenTo3D above by dist along positive direction of normal to the Viewing Plane, which can be called line of view. There is no need to call ScreenTo3D prior this method. Call to this method with dist = 0.0 will return the same point as ScreenTo3D.


HRESULT ScreenToEyeFrame(int xWnd, int yWnd, double* x, double* y)

Returns point in View plane (x,y palne of eye frame), which corresponds to the specified window point.