So far in my game, I have been rotating by rendering w/ slick2d. I was working, and realized that I needed the coords of a point on an object when it is rotated. So that, say I rotate it 78 degrees: the object should rotate and I should be able to get the coords of (6, 1) on the image, while rotating.
Sorry if it is unclear what I am asking!
EDIT:
I realize that that is incredibly unclear, let me elaborate:
I have a gun that rotates, and I need to shoot from the tip of the gun. The gun’s sprite is 8x8, and the tip is at (1, 6). When I rotate, I want to make the bullets instantiate at the tip, so how would I do that? I tried this post, but it did not work at the last post. Just looped around in circles around the x and y… Useless. So what would I do?
ANOTHER EDIT:
Okay, here is my problem in excruciating detail:
I have a player that I render. Then I have a gun that I render. See the two sprites:
http://imageshack.us/a/img811/3299/v6w.png
I have the gun take the player’s rotation, and fire from a point, 1, 6 on the gun. I want to rotate it. So I do this formula:
float tipx = (float) ((getPlayer().getX() + 1) + 8 * Math.cos(Math.toRadians(getPlayer().getRot())));
float tipy = (float) ((getPlayer().getY() + 6) + 8 * Math.sin(Math.toRadians(getPlayer().getRot())));
shotline = new Line(tipx, tipy, mousex, mousey);
But instead of the line starting at 1,6 on the gun, and ending on the mouse, I get this:
NOTE: Mouse is not visible, but the mouse is in all pictures at the farthest point on the line away from the player.
http://imageshack.us/a/img845/1859/dlny.png