Hi,
I am using VC++ to write ATL COM dll addin for Solidworks. I believe that Solidworks is using OpenGL. I am trying to get the modelview and projection matrix for a IModelView? Any thoughts on how to do that?
Thanks!
Hi,
I am using VC++ to write ATL COM dll addin for Solidworks. I believe that Solidworks is using OpenGL. I am trying to get the modelview and projection matrix for a IModelView? Any thoughts on how to do that?
Thanks!
Search the API help for transform (Help -> API Help)... According to documentation, ModelView->get_Transform() returns the Model space --> View space transform for a ModelView. . Transform matrices can be retrieved from bodies, components, from sketch-to-model... At first glance it seems that you cannot access the projection matrix via API, so I assume you have to calculate it by yourself from viewpoint parameters.
-h-
Hi Heikki,
Thanks for the help. get_Transform actually gives the pixel positions on the screen. I guess I can use Orientation3, Scale and Translation3 to assembly a modelview matrix. Projection matrix is from viewpoint params, that's right, but how to get viewpoint parameters? We do not know camera position or glOrtho parameters.
Thanks!
Have something to add? Share your thoughts — no account required.
Ask the community — no account required