|
From: Michael S. <Mic...@gm...> - 2002-04-12 06:04:27
|
>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+++ affine_inverse, aha is logical because the transformation which is applied on the modell must be inverse to get the position of the camera, >...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*). > >> > (2) How can I get the coordinates of a Sound node in the VRML-world >> > coordinate system? You can get the MV and multiply it with (0,0,0) then you have the vector from the camera to Object, to get the Position, you may add the current position from Viewpoint in the VRML-world coordinate system, and now add the location(field location) of Sound node. I don't know if this work, try it out. Micha. |