Hi,
i use the Irrlicht-Engine for a few houres and i am suppriesed what i can do in a few houres.
but i have one problem:
i created a Spaceship and a few planets.
it moves up and down and it works fine.
now i want to rotate the planets around the spaceship.
i have no idea how does it works. the plantes rotate around there own axes and not around the spaceship.
is there an easy way to implement a rotation of the "planets" around my playership?
Thank you very much
Edwart
"simple" World rotation
-
- Posts: 10
- Joined: Thu Dec 29, 2005 2:42 pm
-
- Posts: 10
- Joined: Thu Dec 29, 2005 2:42 pm
I think I see what you're trying to do.. you need to get the distance between your ship and a planet, rotate it, then add it to your ships position. then i think you'll need to rotate your planet back round in the other direction.
thats a pretty bad way of doing it. you should really have your planets standing still (or orbiting each other) and move your ship and camera around.
Code: Select all
planet->setPosition(
(planet->getPosition() - ship->getPosition()).rotateXZBy(rotation)
+ ship->getPosition());
planet->setRotation(vector3df(0,-rotation,0));