|
From: S. K. B. <bo...@pa...> - 2002-04-12 08:09:57
|
> -----Original Message----- > From: ope...@li... > [mailto:ope...@li...]On Behalf Of -oli- > Sent: Thursday, April 11, 2002 11:25 PM > To: ope...@li... > Cc: S. K. Bose > Subject: RE: [openvrml-develop] getting coordinates from ViewPoint- and > Sound-Nodes > > It worked - but using the inverse matrix: > After the modelview transform I used the following code: > > ***snip*** > VrmlMatrix myMV = MV.affine_inverse(); > SFVec3f globalVP(myMV[3][0], myMV[3][1], myMV[3][2]); > SFVec3f globalVUP(myMV[1][0], myMV[1][1], myMV[1][2]); > +++snap+++ > > ...which stores the ViewPoint position w.r.t. the VRML-world coordinate > system in globalVP and the view-up vector in globalVUP (as I need it *g*). > "MV" ? Is it after viewpoint inverse matrix and navigation matrix ? > > What I still didn't figure out is my second issue: > > > > (2) How can I get the coordinates of a Sound node in the VRML-world > > > coordinate system? > > I.e. independed of the current ViewPoint and w.r.t. the VRML-world > coordinate system. > E.g. if the Sound node (field location = (0 2 0)) is a children of a > Transform node (field translation = (1 0 0)), I need to get the actual > coordinate of the Sound node, which is (1 2 0). What about viewpoint's position and orientation as well as navigation information ? Because in the modelview matrix inside "rc", all these are included. > How can I achieve this?? Other routine "inverseTransform(VrmlMatrix..)" could help you. This will give inverse of the transformation stack above the node. Suggestion !!!! Why don't use const viewpoint as (0,0,0) and const view-up-vector as (0,1,0) and convert sound source's local coordinate to world coordinate using modelview matrix inside "rc"? Thanks, Bose Thanks, Bose |