Hey, I have created a little "top-down" 2D game where you drive around a
little car witch i wrote just to try out the System.Drawing.Graphics stuff in
vb.net, such as rotate image, transparancy and other stuff.
Things are working pretty fine, however I have bumped into a little math
problem.
I have a picture of a car witch are rotated when you stear the car, and the
picture is beeing rotated relative to the cente of the back tire axel of the car
as shown below:
What I'm trying to do now is to calculate where the corners of the car are
when I rotate it relativly to the top left of the form. I need this information to
build a hitbox for the car witch I will use for a collision detection routine later
on.
I know the car's width and height, it's X and Y position relativly to the top left
of the corner and direction angle.
Anyone able to figure out how to calculate this?
little car witch i wrote just to try out the System.Drawing.Graphics stuff in
vb.net, such as rotate image, transparancy and other stuff.
Things are working pretty fine, however I have bumped into a little math
problem.
I have a picture of a car witch are rotated when you stear the car, and the
picture is beeing rotated relative to the cente of the back tire axel of the car
as shown below:

What I'm trying to do now is to calculate where the corners of the car are
when I rotate it relativly to the top left of the form. I need this information to
build a hitbox for the car witch I will use for a collision detection routine later
on.
I know the car's width and height, it's X and Y position relativly to the top left
of the corner and direction angle.
Anyone able to figure out how to calculate this?
Last edited: