Re: [osg-users] Q for getCoordinateFrame in special and matrixManipulator in general
Hi, okay, after some examples debugging i think i got it: a CoordinateSystem is a user added node, which provides methods that allow to setup a matrix with lat/lon instead of cartesian coordinates. on flat environments, there is no need to setup a CoordinateSystem. when getCoordinateFrame(pos) is called in such a case, a matrix with rotation of a default coordinatesystem (001, 010, 001) and translation of pos is returned. if that is somehow correct, i have another question: is it right that, in case of an ellipsoid CoordinateSystem (like in the example "osgsimulation.exe") the rotation-part of the resulting-matrix is depended of the current position? Thank you! Cheers, Christian -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13368#13368 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Q for getCoordinateFrame in special and matrixManipulator in general
Hi robert, thanks for replying. after some thoughts about it, i will ask the second question another way. how can i get a coordinateframe from only providing a position? Code: CoordinateFrame eyePointCoordFrame = getCoordinateFrame( eye ) - respectively holds a coordinateFrame in case of providing (eye) only translation information and the rotation-information would be left unchanged (001, 010, 001)? Thank you! best regards, Christian -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13338#13338 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Q for getCoordinateFrame in special and matrixManipulator in general
Hi Christian, On Tue, Jun 2, 2009 at 12:19 AM, Christian Sam wrote: > - the first thing that confused me was, that Y/Z-vector directions are now > the openGL-way. (is there a reason why OSG normally uses Y as forward-vector?) Yes there is a reason. I presume you also want to know what that reason is... well the OpenGL coordinate frame is essentially screen centric, with Y going up the screen, X to the right, and the +Z going out from the screen. The OSG's coordinate frame is world centric, so +Z is height, +Y is north, +X is east. The models we load a world centric so the OSG's default coordinate fame matches the world. Robert. > - i also often encounterd the functions "getCoordinateFrame(Vec3&)" and > "getUpVector(cf)", e.g: > > Code: > > CoordinateFrame eyePointCoordFrame = getCoordinateFrame( eye ) > if (intersect(eye+getUpVector(eyePointCoordFrame)*distance,... > > > > i have not much practice with matrix transformations, so its a little bit > hard for me to understand the sense of this, but i assume the following: eye > is the position of the camera, and the camera has it's own local > coordinate-system. getCoordinateFrame() / getXVector() provide the world > coordinates from such local coordinate frame. > > i looked up the implentation of getCoordinateFrame(), but i couldn't find out > how it is accomplished, can you explain me how this is done? I'm afraid I can't really make sense of the problem you are having to so can't answer this one. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Q for getCoordinateFrame in special and matrixManipulator in general
Hi community, i'm currently trying to understand how the various camera-manipulators work (trackball, terrain, ufo, etc.) and several questions arrived: - the first thing that confused me was, that Y/Z-vector directions are now the openGL-way. (is there a reason why OSG normally uses Y as forward-vector?) - i also often encounterd the functions "getCoordinateFrame(Vec3&)" and "getUpVector(cf)", e.g: Code: CoordinateFrame eyePointCoordFrame = getCoordinateFrame( eye ) if (intersect(eye+getUpVector(eyePointCoordFrame)*distance,... i have not much practice with matrix transformations, so its a little bit hard for me to understand the sense of this, but i assume the following: eye is the position of the camera, and the camera has it's own local coordinate-system. getCoordinateFrame() / getXVector() provide the world coordinates from such local coordinate frame. i looked up the implentation of getCoordinateFrame(), but i couldn't find out how it is accomplished, can you explain me how this is done? Thanks in advance, Christian -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13315#13315 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org