@Ketan_Lalcheta wrote:
Hello
We need to zoom to specific edge of model. For this, we are using API ProWindowPanZoomMatrixSet(). This is also there in example code. It works perfectly fine to zoom when edge is visible.
How to identify whether it is required to rotate model to make edge visible?
Any thought would be of great help.
Thanks in advance...! Feel free to ask for any clarification.
Regards
Ketan
Ketan,
Don't bother with the edge visibility - this is GLUT related problem and Pro/Toolkit has no API's for it...
You should create a view matrix where you know the edge will be visible and set this view before pan/zoom operation.
To construct a view matrix: from the edge to adjacent surfaces and UV's of the surfaces, having UV's get surface normals at the edge vicinity. Make a matrix from the edge midpoint and one of the normals. you may need to rotate matrix 180 to change view direction.
Apply pan/zoom as before...
HIH.
FV.