Page 2 of 2

Re: Rotate

Posted: Thu Apr 13, 2017 11:55 pm
by Ref
Simple. With orbit center (cx,cy), orbit radii (rx,ry) and angle, calculate the new location of the object.

Code: Select all

function orbit( cx, cy, rx, ry, an )
	local x = rx * math.cos( an ) + cx
	local y = ry * math.sin( an ) + cy
	return x, y
end

Re: Rotate

Posted: Sun Apr 16, 2017 3:50 pm
by Ref
If you want to use push and pop, this might help you????

Re: Rotate

Posted: Tue Apr 18, 2017 4:33 pm
by Miawwe
Could you please make me example with 2 planets that rotate on different speeds please? xd I really still don't know how you use that push and pop.

Re: Rotate

Posted: Tue Apr 18, 2017 6:06 pm
by Ref
As per your request.
Best