i am making 3D Simulation of Solar System
for every planet i have an instance of class Celestial Body. I am using the following code for revolution and rotation of sun, planets & their moons.
world = Matrix.CreateTranslation(0,0,0) * Matrix.CreateRotationY(rotation) * Matrix.CreateTranslation(position) * Matrix.CreateRotationY(revolution);
- rotation is my float variable for rotation of planet around its own axis
- revolution is my float variable for revolution of planet in orbit
- position is to my vector3 variable to put the body in orbit or at its radius from center e.g
postion = new Vector3(70,0,0)
Now it works really fine.
But the problem is i need to locate \ get the position of my planet, to where it has been translated after the Matrix multiplication literally in x,y,x co-ordinates.
How To ? get the current X , Y , Z coordinates of my planet
the other option for me would be to use some maths formula that calculates a 2D circle for me.