Finding rotation based off mouse

BlitzMax Forums/BlitzMax Programming/Finding rotation based off mouse

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Consider two vectors starting at the center of the box. They point to the vertex and to the mouse.

ATan2( my-cy, mx-cx ) - ATan2( vy-cy, vx-cx )

That should be the angle to turn the box so that the vertex moves toward the mouse. m,c,v refer to mouse,center,vertex.

Not tested, but the idea looks right.