|
From: -oli- <ol...@fr...> - 2002-04-12 10:11:37
|
At 13:42 12.04.2002 +0530, you wrote:
> > 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 ?
It's after the modelview transform ("if (vp) { [...] } else { [...] } /*
HERE */ " sth. about line 870).
> > 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?
>What about viewpoint's position and orientation as well as navigation
>information ? Because in the modelview matrix inside "rc", all these are
>included.
No other possibilities?
The matrix is always w.r.t. the OpenGL camera, isn't it?
> > How can I achieve this??
>
>Other routine "inverseTransform(VrmlMatrix..)" could help you. This will
>give inverse of the transformation stack above the node.
I need the viewpoint coordinates in the Sound::render() method then, which
means to have a third class (call it AudioManager) which holds the ViewPoint
>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"?
I also thought about that, but I need the global coordinates of both
listener and sound sources for my further intentions.
Thanks!
-oli-
(Oliver Baum)
|