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.

AppGameKit Studio Chat / Clamping rotation to fixed angles?

Author
Message
Amon
9
Years of Service
User Offline
Joined: 30th May 2014
Location: Shropshire, United Kingdom
Posted: 13th Mar 2019 16:45
I have a gun model that is rotated using GetRawMouseX/Y. How can I cap the value of the rotation while keeping the mouse in the middle of the screen?

I'm very new to 3D with AGKS so please forgive the newbie question.
Imaginations' greatest gift is the knowledge you supply it.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Mar 2019 16:17
Not sure I understand the question. If you want to cap a value:

Keeping the mouse centre screen:
Using AppGameKit V2 Tier 1
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 18th Mar 2019 16:40
wraps an angle
fubar
Amon
9
Years of Service
User Offline
Joined: 30th May 2014
Location: Shropshire, United Kingdom
Posted: 18th Mar 2019 20:48
Here is my code. I wanted to prevent the mouse stopping me being able to move the gun when it leaves the screen bounds in windowed mode. Also, if the mouse reached the edge of the screen in fullscreen I wanted the gun to still rotate with the mouse movement.

Imaginations' greatest gift is the knowledge you supply it.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-19 11:17:12
Your offset time is: 2024-04-19 11:17:12