Ying, Matrix multiplication is not always commutative: http://math.stackexchange.com/questions/170241/when-is-matrix-multiplication-commutative
If the values are out of range, it may be because your point lies outside the projection matrix near and far range. You can call double fovy, ar, znear, zfar; projectionMat.getPerspective(fovy, ar, znear, zfar); to check the values. Glenn Waldron / @glennwaldron On Thu, Jul 24, 2014 at 10:19 AM, ying song <[email protected]> wrote: > Hello Glenn Waldron > > I tried pos1 = P1 * modelviewMat * projectionMat, which gives me different > results, but still, some of the value are out of the range (-1,1). > > I thought that P1 * modelviewMat * projectionMat and projectionMat * > modelviewMat * P1 would give me the same results, but they are different > actually. Would you tell me the difference between them? > > Thanks! > Ying > > [quote="gwaldron"]Ying, I think your multiplication order is backwards; try > > pos1 = P1 * modelviewMat * projectionMat; > > Glenn Waldron / @glennwaldron > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=60440#60440 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

