Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Easiest way to rotate object so that it faces the mouse?

Author
Message
kordman916
12
Years of Service
User Offline
Joined: 5th Oct 2007
Location:
Posted: 27th Jul 2013 08:49
I'm working on a top down project and I was wondering how would I get the object to rotate depending on where the mouse is on screen.

AMD FX 6300 hex-core processor 3.5 GHZ
16 GB DDR3 ram, Geforce 660 Ti 2GB ram
Kezzla
11
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 28th Jul 2013 07:23
try something along these lines.



I'm not a complete idiot -- Some parts are just missing.
Burning Feet Man
12
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 30th Jul 2013 08:52
Check out the "Atanfull" command. I use Atanfull to rotate all sorts of 2D shapes towards other 2D points.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
kordman916
12
Years of Service
User Offline
Joined: 5th Oct 2007
Location:
Posted: 3rd Aug 2013 08:27
I tried the code but something didn't work quite right... I want the object to face the mouse and rotate depending on where it is.

AMD FX 6300 hex-core processor 3.5 GHZ
16 GB DDR3 ram, Geforce 660 Ti 2GB ram
WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 3rd Aug 2013 20:02
This is how to use ATANFULL as Burning Feet Man suggested.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2020-01-20 17:01:12
Your offset time is: 2020-01-20 17:01:12