gwaldron / osgearth

3D Maps for OpenSceneGraph / C++14
https://www.pelicanmapping.com/home-1/opensource
Other
1.48k stars 774 forks source link

A question about rotation of the earth #2603

Closed jeekjie closed 1 month ago

jeekjie commented 1 month ago

Hi,I have a problem with the rotation of the earth.I use a osg::MatrixTransform and a osg::NodeCallback to rotate the earth,but I found that the earth didn't rotate as expected.When I replace the earth with other osg Models,the code works fine.Could anyone help me?Thanks! My Environment: OSG:3.6.5 OSGEarth:3.5.0 IDE:Visual Studio 2017 OS:Windows 10 caps main.zip

gwaldron commented 1 month ago

The EarthManipulator keeps your camera pointed at the same location. So the earth is rotating, but your camera is rotating along with it.

jeekjie commented 1 month ago

The EarthManipulator keeps your camera pointed at the same location. So the earth is rotating, but your camera is rotating along with it.

I find that the code works fine with OSG3.4.0 and OSGEarth2.8,so anything different in newer version?

jeekjie commented 1 month ago

The EarthManipulator keeps your camera pointed at the same location. So the earth is rotating, but your camera is rotating along with it. you could try to run the code from the main.cpp with OSG3.4.0 and OSGEarth2.8, and the earth will rotate normally.

jeekjie commented 1 month ago

The EarthManipulator keeps your camera pointed at the same location. So the earth is rotating, but your camera is rotating along with it.

Problem solved,thanks!