Prakash Mahesh (prakash++at++drawcomp.com)
Fri, 29 May 1998 18:44:06 -0400
I need to know the 'location' of the viewer in the scene space. Getting
the base viewpoint matrix is simple, but having problems with getting
the matrix that's been modified as a result of any mouse movement. At
the moment I have the following code which works fine except for one
problem. In perfly the sceneDCS used for the trackball mode is deleted
when you switch to drive or fly, so it defaults when you switch back to
trackball mode from drive or fly mode. The xformer & viewMat matrixes
are not updated while in trackball mode, so that will not work either.
Is there any simple solution to obtaining the xyz 'location' of the
viewer within the scene?
pfMatrix *
gfx_perf::getMouseMatrix()
{
static pfMatrix matr, offs;
if(ViewState->xformerModel != PFITDF_TRACKBALL) {
//matr = ViewState->viewMat;
ViewState->xformer->getMat(matr);
matr.mat[3][0] = -matr.mat[3][0];
matr.mat[3][1] = -matr.mat[3][1];
matr.mat[3][2] = -matr.mat[3][2];
} else {
ViewState->sceneDCS->getMat(matr);
matr.mat[3][1] += ViewState->sceneSize;
}
}
Thanks.
--
Prakash Mahesh
prakash++at++drawcomp.com
--or--
prakash++at++openworlds.com
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:27 PDT