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 / Help with a simple mousez() problem

Author
Message
Getix Interactive
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: US
Posted: 16th Oct 2006 14:43
Hello all. I'm using mousez() as a camera angle controlling device.

Instead of it needing to be pushed back (the mousewheel), I want it to increase the pitch of the camera with each click. Every time the mousewheel is clicked, one way or another, it adds 120.
Any help on this would be great.
Jim

What can games do for you?
www.getixinteractive.com
Trowbee
21
Years of Service
User Offline
Joined: 12th Apr 2003
Location: United Kingdom
Posted: 16th Oct 2006 15:38 Edited at: 16th Oct 2006 15:39
Thats how mousez() works.
What I think you're after instead, is mousemovez(). Then divide that result by 120, and pitch camera accordingly.

Getix Interactive
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: US
Posted: 16th Oct 2006 17:39
Thanks!

What can games do for you?
www.getixinteractive.com
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 16th Oct 2006 19:02
here is an snippet from my code i use in my matrix editor
as you can se do i here register the current mouse z position after using it.
so wathever you have moved it to before will it respond precisly as you want. cheers

if selected_object>0 and pick_obj_menue=0
`-----------------rotate object with mousewheel---------------
if mousez()< msz#
yrotate object selected_object,wrapvalue(object angle y(selected_object)+400.0*move#)
rot=1
endif
if mousez()> msz#
yrotate object selected_object,wrapvalue(object angle y(selected_object)-400.0*move#)
rot=1
endif
endif
msz#=mousez()

Login to post a reply

Server time is: 2024-11-26 09:25:38
Your offset time is: 2024-11-26 09:25:38