Rotating a scene while holding down the mouse?

Hello Java Development community,
I'm currently working on the beginnings of a 3D game that allows rotation, translation, and zooming of the scene/camera, but I've come across a problem that I can't solve. I want the scene to continually rotate when I press my mouse down on a side of the canvas and hold it there, but I'm not sure how to do that. I have a MouseListener that tells me where the user clicked/pressed and thus which way to rotate, but it will only rotate one unit per click. I want it to continually rotate at some rate while the mouse is held down. I don't know if this is possible, but any help would be much appreciated.
Thanks,
Jake

Sorry, I wasn't that clear in the original post. I have a MouseListener and a MouseMotionListener. I have been able to record mousePressed and mouseDragged events, but mouseDragged events only fire when the mouse is held down and moved from the place where it was clicked. I want the scene to rotate while the mouse is held down and not moving. Maybe I'm missing something really basic or obvious here... I had tried making a silly loop in the mousePressed method that checks to see whether some boolean toggled by the mouseDragged method is true or not, but that doesn't seem to work because the program never leaves the loop to record other events that would change the loop condition...
e.g. public class MyMouseListener implements MouseListener {
      public void mousePressed(MouseEvent e) {
            condition = true;
            while (condition) {
                 System.out.println("hi");
                 // rotate scene by x degrees
public class MyMouseMotionListener implements MouseMotionListener {
      public void mouseDragged(MouseEvent e) {
            condition = false;
            System.out.println("bye");
} Stupid, I know. But maybe it will help you see my problem.
Message was edited by:
jakeInJava

Similar Messages

  • I cannot eject a CD from my MacBook Pro.  I tried restarting the computer and holding down the mouse and restarting it to no avail.  On Finder, nothing is showing up on the CD Drive.  Any ideas on how I can eject it?

    I cannot eject a CD from my MacBook Pro.  I tried restarting the computer and holding down the mouse and restarting it to no avail.  On Finder, nothing is showing up on the CD Drive.  Any ideas on how I can eject it?

    How force eject disc: Apple Support Communities
    Mac Mini: Eject DVD Apple Support Communities
    https://www.macupdate.com/app/mac/49129/forceject-too
    Get help with the slot-loading SuperDrive on your Mac computer - Apple Support

  • Help! when i turn on my mac while holding down the option key to swith from windows to mac (i have just installed windows via bootcamp) it comes up with a white screen with a grey padlock asking for a password.

    I have not installed the windows drivers yet if that is relevant. here is a video of the problem https://www.youtube.com/watch?v=xR9dQPSIyNg

    Welcome to the Apple Support Communities
    That's the EFI password. If you don't know the password, the only thing you can do to turn it off is to take the Mac to an Apple Store.
    If you know the password, follow these steps to turn your EFI password off:
    1. Press Command and R keys while your Mac is starting to start into OS X Utilities.
    2. Go to Utilities menu > Firmware Password Utility, turn it off and restart your Mac

  • Macbook Pro is slow, freezes constantly and I'm forced to hold down the power button to turn it off.

    Hey all,
    This is my first post/discussion so hopefully I'm posting in the right section and all. Anyway, as of recently (few days) my Macbook Pro 15" (model previous to the one just released) has been been slow + lagging, also when this happens my computer freezes, but its kind of different: I can still move the cursor around and stuff, but for instance, if its google chrome that freezes I won't be able to close it, (tried force quit), after this, my whole computer kinda freezes and I can't close any of my programs, I can't click on the menu's at the top to shut down or doing anything really, eg. change internet connections. Closing my macbook, like shutting the lid doesn't solve anything, only turning it off by holding the power button for a few seconds, which I'm almost certain isn't a good thing. I've had to do this like 3 times today and its getting pretty frustrating.
    Something tells me that it might be because of memory usage, but I'm not entirely sure, I only say this because when looking at the available/free memory using iStat sometimes, its really low, like 12mb, 30mb, etc.
    Anyway, I know that's quite a lot of infomration but hopefully its useful, if there's any additional information you require that may be of help to you, please tell me and I'll do my best to provide it.
    Thanks,
    Roshen.

    Roshen,
    There are a couple of things you can try, but it sounds to me as if it's a problem with your hard drive.
    First, open Activity Monitor in your Utilities folder and see how much of your CPU % is being used by any one application (you can sort by %). If any one application/process is taking up more than 15% or so of your CPU, try killing (quitting) the process.
    Second, since yours is a 2011 model, it will have come with Lion installed. Shut down your machine and boot up while holding down the Command and R keys. Open Disk Utility and verify your disk. If it comes up with errors, click repair.
    If neither of these work, take your MBP into your local Apple Store. You should still be under warranty, even if you didn't purchase AppleCare. All beforehand and make an appointment.
    Good luck,
    Clinton

  • My CD will not eject, tried holding down the trackpad and restarting still won't eject.

    My cd will not eject.  I tried restarting my Mac while holding down the trackpad, still it will not eject.  I hear it try to open but nothing happens.

    If you have a Retina model then you don't have a built in Superdrive, it would be external. As far as I know the holding down of the trackpad to Force Eject a CD/DVD disc from the drive only works on models that have built in CD/DVD drives. So you'll need to take ther drive apart to get the disc out.
    More than likely your external Superdrive has failed in some way, like the moter that is used to take in and eject the disc has failed.
    In the future buy a new DVD drive that is a tray load design. Any brand will work with your Mac. It does not have to have the Apple name on it to work properly on any Mac computer.

  • While playing a game my iphone went completely frozen, it does not respond to any input, not even to holding down the on/off hey. Any ideas?

    While playing a game my iphone went completely frozen, it does not respond to any input, not even to holding down the on/off hey. Any ideas?

    Try a reset. That is holding the sleep/wake and home button together until you see the Apple logo and release. That will reset the iPhone, but will not affect your data.
    Thanks! It worked just fine!
    MRP66

  • I found an iphone3 and it has a passcode... I tried holding down the home and power button to reset the phone while connected to my itunes, but the phone doesnt reset or even turn off. What can i do to use this phone

    I found an iphone3 and it has a passcode... I tried holding down the home and power button to reset the phone while connected to my itunes, but the phone doesnt reset or even turn off. What can i do to use this phone

    I found an iphone3 and it has a passcode... I tried holding down the home and power button to reset the phone while connected to my itunes, but the phone doesnt reset or even turn off. What can i do to use this phone
    We were going by your post. 'What can i do to use this phone"...
    No offense intended, it's just that we see thousands of posts where people have different reasons for trying to use a stolen or lost device.

  • I was recently updating my phone to the newest software after ios7. It froze for quite a while so I tried holding down the home button and the power button and it shut off. Now it says I have to restore my whole phone but an Error keeps occurring?

    I was recently updating my phone to the newest software after ios7. It froze for quite a while so I tried holding down the home button and the power button and it shut off. Now it says I have to restore my whole phone but an Error keeps occurring? It brings me to a website saying the steps to possibly fix it but I don't find them helpful

    http://support.apple.com/kb/TS1275

  • My macbook won't start up i have used the option command p r while holding down power button but not done.. please help guys

    my macbook won't start up i have used the option command p r while holding down power button but not done.. please help guys

    It not polite to repost asking fro more help three minutes after initial post.
    Recovery mode is Command & R keys after depressing and releasing the Power button  for a normal startup.
    OS X: About OS X Recovery - Apple Support
    That only works for Lion and later.
    What exactly happens when your try to boot to Recovery?
    Try starting in Safe Mode resetting the SMC and NVRAM/PRAM
    OS X: What is Safe Boot, Safe Mode?
    Intel-based Macs: Resetting the System Management Controller (SMC)
    About NVRAM and PRAM
    What model MacBook Pro and what OSX version was on the Mac?
    Have you tried booting from an OSX install DVD?
    When you try to start doe the Power light light?
    This is the Mac Pro desktop forum. I requested your post be moved to the MacBook Pro laptop forum.

  • My computer was rebuilt this week and I am in the process of setting up iTunes and have a weird setup issue. The music in my playlists plays but the same song doesn't play from the library. Initially, I opened ITunes while holding down Shift of control.

    My computer was rebuilt this week and I am in the process of setting up iTunes and have a weird setup issue. The music in my playlists plays but the same song doesn't play from the library. Initially, I opened ITunes while holding down Shift of control key.

    Scratch the post above - the musics that plays in the playlist also plays in the library and that is because i forgot that i imported from the cd yesterday. Basically, I see the rest of my music, but it doesnt' play and tells me it can't locate the file though the location in 'perferences' points to the correct location. Getting iTunes to play after a new computer or rebuild is a headache.

  • While downloading an ITunes upgrade, my Ipad froze.  All I see is the Itunes logo and a picture of a USB cable.  Everything is frozen.  Tried resetting by holding down the wake button but I get no slider button. IPad is frozen.

    While downloading an ITunes upgrade, my IPad froze.  All I see is the ITunes logo and pic of a USB cable on my screen.  Tried to hold down the wake button while connecting the USB cable to override it but no results.  Still frozen with ITunes logo.  Any thoughts or suggestions?

    Force your iPad into Recovery Mode
    1. Disconnect the USB cable from the device, but leave the other end of the cable connected to your computer's USB port.
    2. Turn off the device: Press and hold the Sleep/Wake button for a few seconds until the red slider appears, then slide the slider. Wait for the device to turn off.
    3.While pressing and holding the Home button, reconnect the USB cable to the device. The device should turn on.
    4. Continue holding the Home button until you see the "Connect to iTunes" screen. When this screen appears, release the Home button. iTunes should alert you that it has detected a device in recovery mode. Click OK, and then click Restore to restore the device.
    Note: Data will be lost. You may have to repeat the above many times.

  • Dropped my iphone while making a phone call and when i picked it up the screen was black and now it will not turn on. I have tried holding down the home and power buttons for over 2 hours and it is not working! help :(

    i dont know how to fix this help

    Basic Troubleshooting Steps when all else fails
    - Quit the App by opening multi-tasking bar, and swiping the App upward to make it disappear.  (For iOS 6, holding down the icon for the App for about 3-5 seconds, and then tap the red circle with the white minus sign.)
    - Relaunch the App and try again.
    - Restart the device. http://support.apple.com/kb/ht1430
    - Reset the device. (Same article as above.)
    - Reset All Settings (Settings > General > Reset > Reset All Settings)
    - Restore from backup. http://support.apple.com/kb/ht1766 (If you don't have a backup, make one now, then skip to the next step.)
    - Restore as new device. http://support.apple.com/kb/HT4137  For this step, do not re-download ANYTHING, and do not sign into your Apple ID.
    - Test the issue after each step.  If the last one does not resolve the issue, it is likely a hardware problem.

  • Trackpad "buttons" disabled while holding down key on keyboard

    Hello,
    ben having the following issue with the trackpad on this laptop:
    when playing games and holding down the W-key for example, the click functionality on the trackpad seems to be disabled. Neither tapping the trackpad nor clicking the lower left side works, untill i release the said keyboard key.
    the most usual issue, the entire trackpad beign disabled while typing is already "fixed" by turning the palm check off entirely. But dont seem to find option that enables the mouse button presses.

    @kekeplasteri ,
    Hello and thank you for posting on the HP support forums.  Here is a link you may find of use to help you with your touchpad issue.
    Using and Troubleshooting the TouchPad or ClickPad (Windows 8)
    Please let me know how things go.  
    Post back if you need any further assistance.
    Thank you again for posting and have a great day.
    Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
    Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
    D5GR
    I work on behalf of HP

  • How do i reload 10 4 x when my system will only shut down by holding down the power button. G4 Imac 17"

    how do i reload 10 4 x when my system will only shut down by holding down the power button. G4 Imac 17"

    Power down, hold the Mouse button AND the Option/alt button down at bootup, that should open the CD/DCD tray & you can insert your Install Disc, as well as giving you boot options.
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu. (In Mac OS X 10.4 or later, you must select your language first.)
    Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair. Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)

  • My wireless keyboard keeps thinking I'm holding down the UP Arrow.

    I'm running into this more and more.  My wireless keyboard starts thinking I'm holding down the UP arrow - even if I'm not home.
    o I'll come home, the computer is "awake" and the keyboard's battery is nearly drained.
    o Or, I'm in the middle of typing something and the cursor zips to character position 0 and I'm typing in the start of the message.
    o Or I'm scrolling (using the mouse) and the computer fights with me, tryng to scroll the page up while I'm trying to scroll it down.
    The only cure is to press the DOWN arrow several times until the UP arrow releases.
    Is this a known condition with a documented solution, or do I need to consider replacing the keyboard?

    Go to: Apple / System Preferences / Keyboard / Keyboard Shortcuts / select Keyboard & Text Input and click the Restore Defaults button.

Maybe you are looking for

  • Deploying visual studio 2008 project with crystal reports

    I have deployed an application using ClickOnce.  The application works except that I am getting a "Load Report failed" error.  I am able to view reports on my developer machine, but when I deploy it I get the error. What causes this and how can I fix

  • Brand new iPod classic 160 gb won't show up in iTunes devices

    Brand new iPod classic 160 gb won't show up in iTunes devices. The iPod is fully charged, iTunes reckonises my iPod touch, iPad, iPhone 3G and iPhone 4, but not the iPod classic, although it says the iPod is connected it doesn't register in iTunes.

  • Back camera and power buton not working

    hello dear ,               i have problem in my i phone 4,s camera and power buton . how can i replace it

  • BlackBerry Tablet OS Plug-in for Adobe Flash Builder 4.5

    Hi Recently my FB 4.5 Updater automatically downloaded and installed BlackBerry Tablet OS Plug-in for Adobe Flash Builder 4.5 I do NOT need this plug-in. I have got to get rid of it from system. But there seems to be no way to uninstall it. I have tr

  • Does Endeca Server(Mdex) in latitude support East Asian languages?

    Hi, we're on latitude 2.2.2 the Mdex engine in Latitude is different from the one in Infront, without Basic RLP to do the indexing and word segmentation for East Asian Language. In this way latitude cannot support Chinese or Japanese keyword search.