Manos Papadakis
Manos Papadakis

Reputation: 593

Orbit object around a specific object using glm

In short: I have to create our solar system and specific the sun,afrodite and earth. The sun is set to the origin and the afrodite and earth are orbiting around sun (translate them). I want to create the moon which will be orbiting around the earth.

How can I rotate an object around a specific point and in this case around the center of earth? As far as I know how to rotate an object around in the origin.

Upvotes: 1

Views: 634

Answers (1)

parker.sikand
parker.sikand

Reputation: 1381

This is not a high quality answer but the basic idea is this:

  1. Let the earth be at the origin
  2. Get the moon into position via a translation then rotation
  3. Now let the sun be at the origin and move the earth & moon together into place with another translation then rotation.

Upvotes: 1

Related Questions