|
From: -oli- <ol...@fr...> - 2002-04-11 17:55:13
|
At 12:13 11.04.2002 +0530, S.K. Bose wrote:
> > (1) How can I get the coordinates of the actual ViewPoint, i.e. including
> > the user navigation transformations, in the VRML-world coordinate system
> > (_not_ the OpenGL coordinate system)?
>
>You go through the code "NodeBillboard::billboard_to_matrix(...)" or
>"NodeLOD::render(..)". Here you will find how to get viewer position w.r.t.
>local coordinate system. For your case don't inverse it.
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*).
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).
How can I achieve this??
Thanks again for help!
-oli-
(Oliver Baum)
|