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.

Dark GDK / Dark gdk: Need help rotating an object

Author
Message
spring water
15
Years of Service
User Offline
Joined: 15th Jan 2009
Location: Eugene OR
Posted: 19th Jan 2009 23:31 Edited at: 22nd Jan 2009 18:39
For some reason that I dont understand my code rotes the object using the wheel on the mouse but only in one direction. colonel x only rotates clockwise , heres the relevant snippet.
thanks for your help!

If you're not livin', you're already dead!
spring water
15
Years of Service
User Offline
Joined: 15th Jan 2009
Location: Eugene OR
Posted: 20th Jan 2009 01:45
Hooray, i figured it out, This has to do with understanding the mouseZ controls, I assumed it was a wrap value , it is actually a range of 0-100, the new code was rediculously simple dbRotateObject (11, 0, dbMouseZ ()* -.35, 0)[\code] for those who want to know. The negative .35 number just slows the rotation enough for my liking. But still puzzlingly dbMouseMoveZ () supposedly returns the difference of present and prior mouse movements, but in my case the number actually seemed to be always negative, or 0 no matter which way I spun the wheel. So anyway I got it working but could stand to grasp this mess a little better still.

If you're not livin', you're already dead!
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 21st Jan 2009 20:43
dbMouseMoveZ() returns 120 if the mouse is being scrolled one way, -120 if it is being scrolled the other, and 0 if it is not moving.

dbMouseZ() returns a multiple of 120 depending on the number of notches moved.

[b]Yuor signutare was aresed by a deslyxic mud...
BOX2D V2 HAS HELP FILES! AND A WIKI!
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 22nd Jan 2009 03:53
It depends on the mouse or mouse settings, mine goes in steps of 30.

spring water
15
Years of Service
User Offline
Joined: 15th Jan 2009
Location: Eugene OR
Posted: 22nd Jan 2009 18:38
Ahh this clears things up even more while at the same time complicating it, I was able to get a usable value by just inserting the dbmouseZ(), other than that had no luck. but I may try to look at my mouse setting just to satisfy my curiosity. thanks for the help.

If you're not livin', you're already dead!

Login to post a reply

Server time is: 2024-11-25 11:31:16
Your offset time is: 2024-11-25 11:31:16