Image Rotate to follow mouse position?
Image Rotate to follow mouse position?
Image Rotate to follow mouse position?
Image Rotate to follow mouse position?
Image Rotate to follow mouse position?
Image Rotate to follow mouse position? Image Rotate to follow mouse position? Image Rotate to follow mouse position? Image Rotate to follow mouse position? Image Rotate to follow mouse position? Image Rotate to follow mouse position? Image Rotate to follow mouse position? Image Rotate to follow mouse position?
Image Rotate to follow mouse position? Image Rotate to follow mouse position?
Image Rotate to follow mouse position?
Go Back  Xtreme Visual Basic Talk > > > Image Rotate to follow mouse position?


Reply
 
Thread Tools Display Modes
  #1  
Old 09-13-2011, 05:38 AM
AeonDemon AeonDemon is offline
Newcomer
 
Join Date: Sep 2011
Posts: 1
Exclamation Image Rotate to follow mouse position?


In a game i am making, as the mouse cursor i have crosshairs (like those in FPS games) and i would like an image box to change images as the mouse moves so that it appears that the character in the picturebox is following the mouse cursor. i thought i would do something along the lines of first finding out which side of the picture box its on (left or right) then finding out exactly where with some maths equations and then assigning 1 of 60 pictures so that it appears that the picture is rotating.

but im not sure exactly how to get it going. Any suggestions?
Reply With Quote
  #2  
Old 09-13-2011, 11:04 AM
passel's Avatar
passelImage Rotate to follow mouse position? passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,028
Default

So what does the game look like?
Is it to emulate a FPS, so you don't see the character itself in a "wingman" view?
Is the plan for only a horizontal view, not looking up or down, and the view can scan around the horizon a full 360 degrees, using 60 pictures representing the view every 6 degrees?
The character can only spin in place, can't move forward or back?
If the above is true, and you're really creating 60 overlapping images of your 360 degree scene, then the math doesn't seem like it would be complicated.
You would have a "dead zone" of some number of pixels at the center, and then as the mouse moves beyond that zone, you calculate a turn rate based on how far beyond the dead zone the mouse is.
You would apply the turn rate to the view angle.
Once your computed angle is within 3 degrees (assuming the 6 degree spacing you implied) of a given image angle, you would would switch images.

I don't know how you're going to generate all those images.
And standing in one place seems kind of limiting as a game format.
Perhaps you should investigate using XNA, or something more suited to this type of game development.
Even if I was going to stick with Windows Form and GDI+ and GDI API graphics, I would probalby work on implementing some texture mapping and tiling type operations, rather than a lot of pre-rendered fixed imagery.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
Reply

Tags
image rotation


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Image Rotate to follow mouse position?
Image Rotate to follow mouse position?
Image Rotate to follow mouse position? Image Rotate to follow mouse position?
Image Rotate to follow mouse position?
Image Rotate to follow mouse position?
Image Rotate to follow mouse position? Image Rotate to follow mouse position? Image Rotate to follow mouse position? Image Rotate to follow mouse position? Image Rotate to follow mouse position? Image Rotate to follow mouse position? Image Rotate to follow mouse position?
Image Rotate to follow mouse position?
Image Rotate to follow mouse position?
 
Image Rotate to follow mouse position?
Image Rotate to follow mouse position?
 
-->