Is there a good way to set the rotation and orientation of the SpotLight to match the attitude of the model?

classic Classic list List threaded Threaded
2 messages Options
newlife958 newlife958
Reply | Threaded
Open this post in threaded view
|

Is there a good way to set the rotation and orientation of the SpotLight to match the attitude of the model?

Hello, Have a Nice Day!

I implemented Spot Light by referring to osgearth_lights.cpp.

However, it is having difficulty in implementing SpotLight to change direction according to the heading of the aircraft at the same location.

Even if I get the Pitch, Roll, and Heading values of the aircraft and set the values in the light->Direction() of Light, even if I add them to the osg::PositionAttitudeTransform object and set the values in setAttitude(), the desired result is not obtained.

In common sense, I think you can only rotate the SpotLight's z axis to match the aircraft's heading... The result is not implemented as expected.

Is there a good way to set the rotation and orientation of the SpotLight to match the attitude of the model?

Thank you.

newlife958 newlife958
Reply | Threaded
Open this post in threaded view
|

Re: Is there a good way to set the rotation and orientation of the SpotLight to match the attitude of the model?

I've been trying for weeks to get the lights to match the aircraft's heading position, but the results are unsuccessful...

Is there anyone who can give you a tip on what I want to implement?

Help me..