Lars, I haven't seen any problems with sectoring, but it's been years since I last looked into it.
The original code short circuited the matrix calcs and just populated the final matrix. I'm sure this was done for efficiency, and needs to stay that way (AFAIK). I'd be interested in seeing the difference between your final matrix and the original one. Brian [EMAIL PROTECTED] wrote: ----- To: "[email protected]" <[email protected]> From: Nilsson Lars <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] Date: 03/17/2008 10:43AM Subject: [osg-users] Problem with LightPoint Hi When I tested airport lighting with OpenSceneGraph, the directional light did not work the way I expected. The light was visible a bit outside the defined sector. Especially for the PAPI (Precision Approach Path Indicator), it is important that the angles are correct. After rewriting a small piece of code in osgSim/Sector.cpp it seemed to work as I wanted. The change made was in the function computeMatrix() as shown below. void DirectionalSector::computeMatrix() { double heading = atan2(_direction[0], _direction[1]); double pitch = atan2(_direction[2], sqrt(_direction[0]*_direction[0] + _direction[1]*_direction[1])); double roll = _rollAngle; _local_to_LP = osg::Matrixd::identity(); _local_to_LP.preMult(osg::Matrix::rotate(heading, 0.0, 0.0, -1.0)); _local_to_LP.preMult(osg::Matrix::rotate(pitch, 1.0, 0.0, 0.0)); _local_to_LP.preMult(osg::Matrix::rotate(roll, 0.0, 1.0, 0.0)); } I am certainly not sure if this change is correct in all aspects, but it solved at least the problem for me. Has anyone else discovered similar problem about light points? Regards, Lars Nilsson _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

