|
From: S. K. B. <bo...@pa...> - 2002-04-11 06:41:19
|
> -----Original Message----- > From: ope...@li... > [mailto:ope...@li...]On Behalf Of -oli- > Sent: Wednesday, April 10, 2002 8:46 PM > To: ope...@li... > Subject: [openvrml-develop] getting coordinates from ViewPoint- and > Sound-Nodes > (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)? > I have found some code concerning this in VrmlScene.render(). But > how can I > get the position out of the modelview-matrices used here? After a > MV.getTransform(pos,...) the values in pos don't change even if I > turn the > scene around the viewer (or the viewer around the scene, which > probably is > more correctly). I also need some information (e.g. view-up-vector) about > the ViewPoint's orientation. 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. > > (2) How can I get the coordinates of a Sound node in the VRML-world > coordinate system? > It seems to have something to do with the rc.getMatrix() method, > but how do > I get the position out of the matrix? Can I multiply the matrix with the > position field of the Sound node? Definitely yes. Thanks, Bose |