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.

Author
Message
simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 15th Jun 2003 19:30
can somebody post me a snippet, that rotates an object 90 degree in z, for each click of the mousewheel.
I can get it to work one way,, or the other, but not both.......

Really, no need for the 3d code, just summat like :
if mousewheel click up, then inc value
if mousewheel click down, then dec value.....

I can get it to work with both lines at a time ???
Trowbee
23
Years of Service
User Offline
Joined: 12th Apr 2003
Location: United Kingdom
Posted: 15th Jun 2003 19:47
Im guessing by "for each click of the mousewheel" you mean scrolling.
If so, the syntax for the mousewheel is mousez, or mousemovez, so I guess you put something like this together:

If mousemovez()>0
rotate object code
endif
If mousemovez()<0
rotate object code (other direction)
endif

If you mean actually clicking the mousewheel, the syntax is mouseclick()=4
simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 15th Jun 2003 20:10
yep, I mean like you said...
I also use the mouseclick()=4 to finalise the object position.

but could you do me a favour....?

could you code it?

I basically did exactly as you have it in your post, but it only worked if I `remed-out` one of the directions.

oh, the catch is, ( although I dont think this caused the problem )
I place the object on a matrix, grid X,Z position, and the objects are always 2 matrix sqaures long ( 16,16,32 )
and I want the object to rotate about the matrix grid I select.
IE, I want to rotate the object about a given location, NOT the object center.

I`m `not too worried` about rotate about a location bit, as I`m sure that is ok....

I`m more concerned about if there is a problem with my mouse drivers ?

I`m on WIN XP, MS intellieye mouse, with standard XP drivers.

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Jun 2003 20:31
There is a problem with the mousemove functions - once you read them, they are reset until the next sync.

Trowbee
23
Years of Service
User Offline
Joined: 12th Apr 2003
Location: United Kingdom
Posted: 15th Jun 2003 21:27
Ack...I'm actually in the middle of exams at the moment, so don't really have time. I just come on here for 5 or so minute's at a time.
If noone else has done it by the time I finish exams (later this week) i'll give it a go.
comic book guy
23
Years of Service
User Offline
Joined: 21st Apr 2003
Location:
Posted: 15th Jun 2003 22:11
hope this is what your looking for
Trowbee
23
Years of Service
User Offline
Joined: 12th Apr 2003
Location: United Kingdom
Posted: 15th Jun 2003 23:20
OK, I got a little bored revising, and remembered this post so I came back to code it.



Basically, if the mouse wheel is moved, it alters the value stored in "direction" and "target"
Then, the DBP checks to see if the object angle is different to "target" (ie: the wheel has been moved, as the variable was changed earlier)
If it is different, it rotates the object by the value stored in direction.
Then, when it cycles back to the beginning, it checks to see if "direction"=0 (ie: wheel hasnt moved, and object angle is what it should be)

Login to post a reply

Server time is: 2026-07-17 17:43:29
Your offset time is: 2026-07-17 17:43:29