How to get the modelview and projection matrix in Solidworks OpenGL context

Discussion in 'SolidWorks' started by humorstar, Nov 4, 2005.

  1. humorstar

    humorstar Guest

    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!
     
    humorstar, Nov 4, 2005
    #1
  2. humorstar

    Heikki Leivo Guest

    I am using VC++ to write ATL COM dll addin for Solidworks. I believe
    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-
     
    Heikki Leivo, Nov 4, 2005
    #2
  3. humorstar

    humorstar Guest

    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!
     
    humorstar, Nov 4, 2005
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.