ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AcGsView Screen vs World Coordinates

0 REPLIES 0
Reply
Message 1 of 1
mbujak
461 Views, 0 Replies

AcGsView Screen vs World Coordinates

Does anyone know how to convert screen coordinates to world coordinates for an AcGsView in a dialog control? I tried using the example as shown in BlockView sample but it doesn't come out as expected. What I want is to trap the mouse click event in the window and get the WCS coordinate of the point (CPoint) point clicked. The xform in the code below is as shown in the BlockView sample. Any ideas?

 

void PreviewCtrl::OnLButtonDown(UINT nFlags, CPoint point)

{

SetFocus();

if(pickingEnabled_)

{

AcGeMatrix3d xform = mpView->viewingMatrix()

 * mpView->worldToDeviceMatrix().inverse());

AcGePoint3d pt = AcGePoint3d(point.x, -point.y, 0);

pt.transformBy(xform);

PointClicked(pt);

}

}

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost