• Advertisement
Sign in to follow this  

Question about mouse coordinate

This topic is 4348 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Mouse direction in 3d world, just like FPS game, can anyone explain to me how this is works, i mean, i read tutorial(not very clear) about this, i tried once, but i messed up, any good tutorial for this ? thanks, and pardon for my godawful grammar

Share this post


Link to post
Share on other sites
Advertisement
Your mouse works in a 2D plane (across the screen). It has a left-right position (x), and a top-bottom position (y). It has one of these for the screen, so if your resolution is 1024x768, and your mouse is in the middle of the screen, it'll be at (512, 384). However, if you're working with a windowed application, there'll be a mouse position relative to the window. So, for the window, the top-left position at the top-left corner of the window is (0, 0), but for the screen it'll be something like (300, 252) or wherever the top-left part of the window is in relation to the screen.

For movement, you keep track of where the mouse cursor was last frame, and get its new coordinates, and see if it went up or down, and left or right. Mouse position isn't really in 3D space (unless you want something like Black and White, which is far more complex).

Share this post


Link to post
Share on other sites
Most games keep the cursor in the middle. When it moves, the game sees the change, moves it back to the middle, then changes the yaw (X) or pitch (Y) by some amount. Usually that amount can be set by some mouse sensitivity setting since people have different ideas of what a movement should equate to.

Share this post


Link to post
Share on other sites
Quote:
For movement, you keep track of where the mouse cursor was last frame, and get its new coordinates, and see if it went up or down, and left or right. Mouse position isn't really in 3D space (unless you want something like Black and White, which is far more complex).


Hey good idea, because last time it wont recognize when i tried to move left or right, either keep going left or right(whether i turn my mouse upside down).

and also a quick question about loading object(picture, 3d human, etc), i tried to use 3dstudio max to draw a human, but i'm not exactly sure how to load this, i heard from my friend it is possible.

Can i load animated human object ?, i mean once i load and trigger it, its automatically run the animation ?

thanks

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement