Archived

This topic is now archived and is closed to further replies.

DI - Joystick - Angle for Justification

This topic is 5244 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i''am querying a joystick device and recieve the position of the joystick as a point. Now i need the angle to justify the object i want to control. I came up with the law of cosine but dont know how to code it in c++. I would be glad to hear an easier way as well. greets flery

Share this post


Link to post
Share on other sites
comon peeps that has to be some common stuff because i think nearly everygame needs to adjust the objects to the mouse or joystick. Maybe its not clear what i mean. If u take a strategie grame for example and u select a unit and want to move it it should move with the front of the model to the point.

Share this post


Link to post
Share on other sites
ok first you''re going to have to designate a "front" point on your model(unless you can assume that the first vertex will always be the front) and then, if you want some simple math, youll rotate the object until the distance between your target point and "front" point is the smallest number you can achieve without actually moving the object.

Share this post


Link to post
Share on other sites