I tried for quite awhile to get this right but it appears the exact algorithm is eluding me.
I need to be able to move a moon around a planet with xrot and yrot in the following format.
Orbit around the center (xrot) is fine but the yrot orbit swings the moon away from the planet. Any help is appreciated.
**I know I could just put a pivot and do turnentity but I need it to function in this exact manner with sin and cos.
I need to be able to move a moon around a planet with xrot and yrot in the following format.
dist# = 300 xrot# = xrot + 1 yrot# = yrot + 1 PositionEntity moon,0+sin(xrot)*dist,0+sin(yrot)*dist,0+cos(xrot+yrot)*dist
Orbit around the center (xrot) is fine but the yrot orbit swings the moon away from the planet. Any help is appreciated.
**I know I could just put a pivot and do turnentity but I need it to function in this exact manner with sin and cos.