Simple 3d rotation problem

I have a symbol of a $10 bill that I want straight rotation like it was spinning like standard sign on top of a building. I created a 3d motion tween and set the y axis to 720 degrees so it would rotate a few times.
Here is the problem. It works but only if I have the symbol at the top of the page. If I move the symbol towards the bottom of the page when the symbol rotates it startts rotating skewed somewhat. Any idea why this is happening and how do I fix it?
thanks

See in the image how the top $10 bill is rotating on it's axis but the bottom one is distorted. They are the same symbol I just copied and pasted one and moved it lower on the screen
and it distorts. I have tried making a new symbol from but it still happens.

Similar Messages

  • Rotation problem after editing in Photoshop

    I'm using Lightroom 1.3 and Photoshop CS3 with all the current updates. This problem was the same in LR1 and PS CS2.
    I have a mix of orientations in the JPEGs in my library - portrait and landscape. When the photos are imported into LR they appear correct. If I select a bunch of them, open them in PS (using Edit in Photoshop > Edit Originals), run a noise filter, save them, and then go back to LR, the previews for the portrait images are rotated so that all the previews show as landscape.
    The portrait images display correctly (except for the fact that they have been rotated) in the Library module - both grid and loupe view). In the Develop module, the image aspect is displayed portrait but the image is as a distorted landscape - the image is rotated and then distorted to fill the portrait oriented space. In the Print module, that same distorted image is fills the portrait oriented page. To be clear, instead of a portrait image appearing in the correct orientation on a portrait page preview, the image is rotated 90 degrees and then stretched to fill the page.
    There is a badge on the preview indicating that the metadata is out of sync with the file.
    If I rotate the image in LR, the badge goes away and the image appears portrait and undistorted in the Library module's grid and loupe views. The Develop module show the portrait image in the correct rotation, but has been stretched to a landscape aspect. The Print module shows that distorted image rotated to fit the portrait page.
    The only way to correct this is to "Read Metadata from file". This resets all the orientation information so that it displays correctly in LR, but all the tags and IPTC information gets erased.
    This is most of the reason why I was writing all the metadata into to files until now. I would write the metadata before editing in PS, do my PS edits, and then back in LR I'd "Read the Metadata" from the files to set everything correctly in LR. But of course now that I'm working with Leopard I get screwed if I do this because my files will crash the Finder.
    To top it all off, I've run into the "...cannot be saved because the file is in use" problem with some files I opened last night.
    Clearly none of these issues are being addressed in Adobe or Apple's updates. Is there a reasonable workaround that will let me:
    1. set metadata and tags and know that they won't either get lost or cause problems
    2. have image orientation respected and displayed correctly
    3. not crash any of the three critical applications on this computer - Lightroom, Photoshop, and Finder.

    I really appreciate your explaining this Jao.
    I'm going to explain how I got into this situation, in the hopes that it may prove useful to someone (I'm looking at you, Adobe) who wants to understand how the app is being used in the real world.
    So as not to break up the narrative, let me just say that I'd be happy (ecstatic, actually) if I could use Lightroom for my entire workflow, but the noise reduction filter in LR is just nowhere near as good as NoiseNinja. (A problem shared by LR, PS, and Aperture.) If I could run NN from inside LR, that would rock.
    Oh, and I shoot JPEG because I shoot live events where the lighting is usually crap and I need to be ready at any moment for something interesting to happen. Shooting RAW would be nice, but it's too slow and takes up way too much space.
    So here's what I do, (hopefully edited to make the reading non-tedious)
    1. import all photos from source (usually memory cards)
    The photos go onto a drive reserved for photos. I shoot events, so everything is organised by date-event. On import I set filenames (date - event name - time stamp.jpg) and keywords.
    2. cull
    They get marked "1" (irretrievably useless, to be deleted), "2" (keep just in case), "3" (decent shots), "4" (photos that I want to show to other people), or "5" (this is one of my best this year). Delete the "1"s.
    3. select 20-30 "picks"
    I create a folder within the event folder called "Picks" for these photos. Then I duplicate that folder as "Originals"
    In doing it this way I can protect myself if I need/want to change my cataloguing application. I'm on my fourth one at this point (Lightroom) and while I am generally finding that LR is meeting my needs more than anything else I've tried, I've been burned in the past (how many of us have regretted letting Aperture put all our photos into an incomprehensible database/folder hell?)
    The Picks/Originals structure makes sure that the originals never get touched (because it doesn't show up in LR) and I can quickly find the Picks.
    I -was- writing the metadata to the files so the ratings, keywords, and IPTC info was where it should be - attached to the photo. I've stopped doing this for the time being until this whole Finder-craching debacle is corrected.
    So why am I not using LR's built "Edit - Copy"/stacking function, which more or less duplicates my process?
    Well part of it was my own dumbness - Aperture made the edited copy/variation a Photoshop file, which ballooned my collections with staggering speed. I'm not sure if LR used to do the same thing, or I just made the assumption. My mistake.
    The other part of the problem is just the simplicity of having an Originals folder that is effectively ignored. Using LR will mix the "-edited" files in with originals, which is not as efficient or elegant a solution, but I'll give it a whirl.
    Thanks for your suggestion. If giving up my Picks/Original process solves the rotation problem then perhaps it's a fair trade.
    Still, it seems that the right hand is somehow oblivious to what the left hand is doing in the whole PS/LR thing, and that it ought not work that way.

  • SIMPLE Database Design Problem !

    Mapping is a big problem for many complex applications.
    So what happens if we put all the tables into one table called ENTITY?
    I have more than 300 attributeTypes.And there will be lots of null values in the records of that single table as every entityType uses the same table.
    Other than wasting space if I put a clustered index on my entityType coloumn in that table.What kind of performance penalties to I get?
    Definition of the table
    ENTITY
    EntityID > uniqueidentifier
    EntityType > Tells the entityTypeName
    Name >
    LastName >
    CompanyName > 300 attributeTypes
    OppurtunityPeriod >
    PS:There is also another table called RELATION that points the relations between entities.

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    check the coloumn with WHERE _entityType='PERSON'
    as there is is clustered index on entityType...there
    is NO performance decrease.
    there is also a clustered index on RELATION table on
    relationType
    when we say WHERE _entityType ='PERSON' or
    WHERE relationType='CONTACTMECHANISM'.
    it scans the clustered index first.it acts like a
    table as it is physically ordered.I was thinking in terms of using several conditions in the same select, such as
    WHERE _entityType ='PERSON'
      AND LastName LIKE 'A%' In your case you have to use at least two indices, and since your clustered index comes first ...
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Have you ever thought of using constraints in your
    modell? How would you realize those?
    ...in fact we did.We have arranged the generic object
    model in an object database.The knowledge information
    is held in the object database.So your relational database is used only as a "simple" storage, everything has go through your object database.
    But the data schema is held in the RDBMS with code
    generation that creates a schema to hold data.If you think that this approach makes sense, why not.
    But in able to have a efficent mapping and a good
    performance we have thought about building only one
    table.The problem is we know we are losing some space
    but the thing is harddisk is much cheaper than RAM
    and CPU.So our trade off concerated on the storage
    cost.But I still wonder if there is a point that I
    have missed in terms performance?Just test your approach by using sufficiently data - only you know how many records you have to store in your modell.
    PS: it is not wise effective using generic object
    models also in object databases as CPU cost is a lot
    when u are holding the data.I don't know if I'd have taken your approach - using two database systems to hold data and business logic.
    PS2: RDBMS is a value based system where object
    databases are identity based.we are trying to be in
    the gray area of both worlds.Like I wrote: if your approach works and scales to the required size, why not? I would assume that you did a load test with your approach.
    What I would question though is that your discussing a "SIMPLE Database Design" problem. I don't see anything simple in your approach when it comes to implementation.
    C.

  • IPad Rotation Problem

    After just 1 week bought the iPad.. i'm facing the rotation problem.. the Apple technicians said its hdware problem and send back to Apple Service Centre... Feel very very sad with this situation... wasting my time and probably my money...

    1. Check the little black rotation lock on the edge of iPad.
    2. Try a reset. Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo.
    http://i1224.photobucket.com/albums/ee374/Diavonex/9ecbcd49.jpg

  • Simple image rotation

    Hi all,
    Have a couple of pages on a site i'm building where i need a simple image rotation / image swap.
    It doesn't have to be anything flash, it's purely for a 200px square image to automatically swap every 5 seconds or so. It doesn't need any user buttons to go to next / previous, or enlarge when clicked.
    I've tried a couple of free jquery ones, but these won't load the starting image until all the images have been loaded into the browser, so you end up with a blank spot, then after say 10 seconds the images appear.
    Looking through the programs forums, it seems that the jquery i'm downloading isn't configurable to preload the images, so maybe i'm going down the wrong route completely!
    Whats the best / simplest way to do this and can you recommend anywhere to read up on how to implement it?
    Thanks
    Dan

    Dan, download the cycle plugin pack first: http://jquery.malsup.com/cycle/download.html. You can copy/ paste in a new .js file and store it locally on your site folder. Or, you could also use the cloud link as I've given below. Both will work.
    Then, include the jQuery library to before closing your </head> tag:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
    Now, include the jQuery cycle plugin library before your </head> tag:
    <script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js"></script>
    Define the DIV that will animate with cycle plugin before your </head> tag:
    <script type="text/javascript">
    $(document).ready(function() {
        $('.slideshow').cycle({
    fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    </script>
    In the above code, Div with class slideshow will keep cycling with a fade effect. Note that for some effects to work, you may require the jquery easing plugin. But, fade will do just fine for your original question.
    Then, structure your image container:
    Based on your original code:
    <p class="pagetext">    <img src="images/hgsindeximg1.png" alt="School pupils" width="300" height="233" class="fltrt">Welcome  to our school website, we hope that you enjoy looking around the site. <br>
        </p>
    You have to restructure it this way:
    <p class="pagetext">
    <div class="slideshow">
    <img src="images/hgsindeximg1.png" alt="School pupils" width="300" height="233" class="fltrt">
    <img src="images/hgsindeximg2.png" alt="School pupils" width="300" height"233" class="fltrt">
    <img src="images/hgsindeximg3.png" alt="School pupils" width="300" height"233" class="fltrt">
    </div>
    Welcome  to our school website, we hope that you enjoy looking around the site. <br>
        </p>
    In the above code, I've added 2 more images that will rotate on your page. Change the filenames to whatever you desire. Also, ensure you retain the image dimensions same across all 3 images for best results.
    If you notice, I've just moved the images into a DIV called 'Slideshow'. As defined previously, all 3 images with <img..> within the div with class slideshow will keep rotating.
    On a sidenote, please please please please change the background color from red to something 'non-distractive'! Seriously, I went searching for moisturizing drops for my eyes once I opened up the test page you had posted!
    Trust this helps.

  • Iphone 6 rotating problem

    My ipone6 has rotating problems with for example the calendar app, somtimes it's working but most of time I can't rotate the screen.
    When is this going to be solved, as I many people are complaining about this?

    Try to reset the phone by holding the sleep and home button for about 10sec, until the Apple logo comes back again. You will not lose any data by resetting, but it can cure some glitches.
    If this does not help, setting it up as new device would be the next step:
    How to erase your iOS device and then set it up as a new device or restore it from backups
    Or, if you want to use your computer and iTunes instead:
    Use iTunes to restore your iOS device to factory settings - Apple Support
    If setting it up as new device does not bring back the full functionality of your brightness settings, get the phone checked by visiting an Authorized Apple Service Provider, Apple Store or contact Apple Support to have it serviced:
    iPhone - Contact Support - Apple Support

  • Im trying to make a simple 360 rotation for a 3d logo in CC 2014 but when i tried to create the 1st key frame the image when out axis

    im trying to make a simple 360 rotation for a 3d logo in CC 2014 but when i tried to create the 1st key frame the image when out axis

    I find that if you have multiple 3d object  they must be merged into a single 3d layer their positions reset to align to the same axises then sized and positioned along them. The layer should then be able to be animated well around an axis like the y axis. Here a Sphere, Cylinder and ring. http://www.mouseprints.net/old/dpr/McAssey-CC.mp4

  • New log rotation problem

    I have resolved some log rotation problem...I have set del log rtation by size...and now the first time the log rotate,but then the output continue to go on the lod with the extension .log001 and not on the configured file.
    why?

    no,it the server rotates the log only the first time but then it continues to write on the .log001.On the original file it continues to write some server exception.
    the server launch line in the scritp is the follow
    nohup "$JAVA_HOME/bin/java" ${JAVA_VM} ${JAVA_OPTIONS_NODE} ${JAVA_OPTIONS} \
    Dweblogic.Name=${SERVER_NAME} \
    Dweblogic.ProductionModeEnabled=${PRODUCTION_MODE} \
    Djava.security.policy="${WL_HOME}/server/lib/weblogic.policy" \
    Dweblogic.Stdout=/u02/bea/weblogic81/mydomain/mydomain_LOG/myserver_Admin.log \
    Dweblogic.Stderr=/u02/bea/weblogic81/mydomain/mydomain_LOG/myserver_Admin.log \
    weblogic.Server > /dev/null &
    and the config.xml part for the server configuration is the follow
    <Server COMEnabled="true" CompleteMessageTimeout="0"
    ConsoleInputEnabled="false" EnabledForDomainLog="true"
    ExpectedToRun="false" JDBCLogFileName="./mydomain_LOG/jdbc.log"
    JDBCLoggingEnabled="true" JavaCompiler="javac"
    ListenAddress="10.2.1.16" ListenPort="10001"
    MaxMessageSize="100000000" Name="myserver_Admin"
    ServerVersion="8.1.3.0" SocketReaderTimeoutMaxMillis="10"
    StagingMode="nostage" StdoutDebugEnabled="true"
    StdoutEnabled="true" StdoutSeverityLevel="16" TransactionLogFilePrefix="../myserver_LOG/myserverAdminTransaction.log">
    <SSL Enabled="false" IdentityAndTrustLocations="KeyStores"
    ListenPort="10002" Name="myserver_Admin"/>
    <Log FileCount="4" FileMinSize="30"
    FileName="/u02/bea/weblogic81/mydomain/mydomain_LOG/myserver_Admin.log"
    FileTimeSpan="1" Name="myserver_Admin"
    NumberOfFilesLimited="true" RotationType="bySize"/>
    <WebServer LogFileCount="2" LogFileLimitEnabled="true"
    LogFileName="./mydomain_LOG/access.log"
    LogRotationPeriodMins="360" LogRotationType="size"
    MaxLogFileSizeKBytes="20000" Name="myserver_Admin"/>

  • Simple image rotator using Fireworks

    I have Design Premium CS4. So I have Flash, Fireworks, Dreamweaver, etc. I'd like to create a simple slide rotator to put on the site. I've created a photo gallery with Fireworks. It's easy but I don't want all the header information and navigation buttons. I just want a simple box on the page where the images will rotate automatically without headings, nav buttons, etc. I know there are simple java scripts out there but I want to try something which is easily configurable and easily modified as the images will be changed frequently.
    Is there a way to configure the Fireworks gallery to not display the header information? Is there another way to accomplish what I want using other programs in Design Premium CS4?
    Thanks in advance for the help.
    Steve

    A quickie way would be to design it as an animated GIF in Fireworks, but save it in Flash format. If you'd like to try this, add the images to seperate 'States', and then choose File > Save As > Adobe Flash SWF. Click the Options button in the Save As Window to set the SWF export options.

  • Rotation Problem on FCP

    Friends,
    When I rotate a video on FCP (does not matter the degrees, 20, 45, 90...), using the motion tab, my rendered images gets sort kind of distortion... When I preview it on FCP, it rotates ok, but when I export using the Compressor, when the video rotates, it squeezes, it does not look right...
    Please, could someone help me?
    Thanks

    Yes - the button is in rotation lock mode (not mute).
    Neither switch setting (up or down) work. The state of the button is accurately reflected on the screen when changed, but the problem of not rotating problem when unlocked persists.
    Given that this started just after updating to iOS 7.0.6 I'm inclined to think there is a software issue.

  • Rotation Problem on 3DS Max 7 Scene Export

    We have been experiencing some anomalies with animations
    exported from 3DS Max 7. We have a set of linked groups that are
    animated along a path and some of the groups also have rotation
    keys. The path animation is always fine, but the rotations will
    sometimes stop short of their destination (even though the key
    exists in Max and it plays properly in Max). If the object happens
    to stop rotating before the timeline finishes, the object will
    continue, very slowly, to rotate to it's final destination by the
    end of the timeline.
    Our animations are primariliy of vehicles, and most of the
    problems occur with tractor-trailer vehicles where the trailer is
    linked to the tractor - so on a turn the trailer never completely
    straightens out. Any ideas?

    Thanks, sws (sorry didn't catch your reply earlier)...
    It's not so much my own learning how to control rotation of the object I'm concerned about (though I can't imagine ever coming to see this type as preferable!) but that a non-3d-literate recipient of my 3dpdf would be confronted with something they had no control over and simply not have the time or patience to persist with.
    As to your saying other methods would make seeing the whole object difficult or impossible, I just don't see that. Looking at any of the Kaon examples shows how really simple - and intuitive - this can be.
    Incidentally, I'm now wondering what are these other types of rotation you refer to? Other types within A3d? How can they be accessed?
    EDIT: I'm thinking I maybe didn't describe the difficulty too well (always find it hard to put 3d transformation into words!). As you see, the Kaon objects do "turn on all 3 axes" but are "grounded" - ie as if attached to a fixed plane and do not simply drift around like an astronaut's toy!
    Sorry can't explain better.
    My thanks for your time...
    Glenn

  • Java 2D Rotate Problem

    I wish to rotate a JPG image in Java 2D and redisplay the
    image with the new dimensions. The problem I have is that when the image is rotated it does not display in the
    new dimensions. For example I have a 20 x 10 image,
    rotated 90 degrees I should see the image in 10 x 20 format. What I see is a portion of the image that is 10 x 10. I do not have this problem with scaling because I reassign my image to the output of the getScaledInstance() method. Is there something simple I am overlooking that will allow the image to show correctly on the screen? My paint method is relatively
    simple currently:
    public void paint( Graphics g )
    System.out.println( "paint()" );
    Graphics2D g2d = (Graphics2D) g;
    g2d.drawImage( image, transform, this );
    g2d.dispose();
    Thanks for the help.

    I am not familiar with this particular package, but have you tried resizing your container. a 20 X 10 image that is rotated 90 degrees will be a 10 X 20. In the same size container the second will have 10 pixels that cannot be viewed due to container size.

  • When will portrait format rotate problem get fixed?

    A Slide Show generated in Organizer and output to Premiere Elements for video editing can still have problems with Protrait Format photos.
    These photos have proper orrientation in both Organizer and the Slide Show when viewed in Orgaizer.  However, when the Slide Show is transfered to Premiere Elements for video editing and production, some Portrait Orrientation photos lose their proper orrientation and end up laying on their sides.
    This problem appears to be camera specific.  My Canon SX230HS is an offender.  This problem can be avoided by using an edited version of the photo.  However, that is a pain if the photo does not otherwise require an edit.  I believe that in PSE/PrE Version 8, the problem could be corrected by a simple rotate left and rotate right sequence in Orgainzer.  However, that "work around" appears to have gone away with the PSE/PrE Version 9.
    This problem is a real pain when producing a slide show containing photos from multiple cameras.  I would think that if PhotoShop Elements, Editor and Orgainzer are aware of Photo orrientation, then Premiere Elements could also have the same intelligence.

    To permanently alter the Rotation of portrait Images, yes, that would be a good workflow.
    I normally shoot in RAW (Nikon or Canon), and then process the Images in ACR (Adobe Camera Raw) through Photoshop. There, I will do the Rotation, and when I Save_As PSD, the Rotation is permanent. For users of Adobe Lightroom, the operation is the same. I assume that it will be the same with PSE, but have to admit that I have never used that program. Still, in most respects, it works just like its "big-brother," Photoshop. Now, I also use Adobe Bridge (big-brother to Organizer), and with that Save_As, it will handle the task of Rotation too.
    One thing that I have never experimented with is the differences between doing the Rotation in an Image editing software, like PS, vs doing it with the Fixed Effect>Rotation in PrE, or PrPro. Based on the Scaling algorithms in PS vs PrE, or PrPro (up to CS 5), I would think that the Image editing software would be a bit better, but that is ONLY a guess on my part, and especially as the Rotation algorithms will be different than the Scaling algorithms. Maybe I need to do some control testing, though my workflow is set up to do the Rotation in ACR.
    Good luck,
    Hunt

  • Image Orientation/Rotation Problem in Lightroom 3.2 Final

    This is a continuation of my previous post regarding this same problem in 3.2RC. It's still happening in the Final version of Lightroom 3.2.
    THE PROBLEM
    Image orientation is not working properly in Lightroom 3.2. This affects newly imported images and images that were already in my Lightroom database -  and which have been in the database since Version 1.
    Here's a screen capture showing the strange displays I'm seeing in  Lightroom's grid mode:
    Notice the odd angle of the image. When I use the Rotate Photo Left tool, the display looks like this sometimes. After a second or so, it will snap to either a vertical or horizontal orientation by itself but rarely gives me the 90-degree rotation this tool should give. The image may flip 90-degrees or 180-degrees, there's no way to tell.
    When I view the image in Loupe view or on my second monitor, the orientation shown in Grid view does not match that displayed in Loupe Vew. For this particular image, Grid view currently shows it as correctly orientated as a horizontal while Loupe view shows it rotated 90-degrees to the right. Shouldn't they match?
    BACKGROUND
    I never had a problem with image orientation in any preveious version of Lightroom prior to Lightroom 3.2RC and 3.2 Final. So, it seems to be a bug in 3.2. I'm still using the same computer and video card I used with previous versions. My operating system is Windows 7 Home Premium. Both Windows and Lightroom are 64-bit.
    HELP!
    Is anyone else having this problem? How can I solve it?
    Alan
    PhtooCitizen.com

    The size of the catalogue is almost certainly not at play here.
    FWIW, I recall seeing something like this once a long time ago on a Mac, possibly with Lr 3 beta, or Lr 2.x.  It went away with a restart. It almost looks like a threading issue, where a thread is suspended or preempted and then is lost or disconnected from the main UI thread.
    I recall you can just rotate the image again and it will right itself.
    Adobe fist-line support seem to want to use the number of images in the catalogue as some sort of catch-all.  The problem with this is that most of us can demonstrate that there is little correspondence with the number of image IDs in the database and many reported UI artefacts.
    I'd keep raising this with them, and suggesting that the size of the catalogue is probably not at play here. As a tactic, you can ask what the maximum size of a catalogue should be, and if it is raw images or the number of changes to the images and virtual copies that is the problem, and if this can be verified by second- or third-line support.

  • Character rotation problem in tiled map

    Hi I am trying to rotate the character in a tiled map. Its is successful but theres problem with moving diagonally. When i pressed for example up and right keypressed, when its moving it will rotate as i wanted but when i released the buttons, it either rotate to the up or right. I want the image to rotate diagonally and stay as it is when i released the buttons.
    Here are my source code...I noe its very long but really need someone help...There are 3 java files. (Sorry for dis long and ridiculous codes...)
    1) Game.java
    import javax.swing.*;
    import java.awt.*;
    import java.awt.image.BufferStrategy;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    public class Game extends Canvas implements KeyListener
         private BufferStrategy strategy;
         private GameMap map=new GameMap();
         private Player player;
         private boolean left,right,up,down;
         Image ship = Toolkit.getDefaultToolkit().getImage("res/up1.PNG");
         public Game()
              Frame frame = new Frame("Pirate Game");
              frame.setLayout(null);
              setBounds(0,30,480,510);
              frame.add(this);
              frame.setSize(480,510);
              frame.setResizable(false);
              // exit the game
              frame.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              frame.addKeyListener(this);
              addKeyListener(this);
              frame.setVisible(true);
              createBufferStrategy(2);
              strategy = getBufferStrategy();
              player = new Player(ship, map, 1.5f, 1.5f);
              // start the game loop
              gameLoop();
    public void gameLoop()
              boolean gameRunning = true;
              long last = System.nanoTime();     
              // keep looking while the game is running
              while (gameRunning)
                   Graphics2D g = (Graphics2D) strategy.getDrawGraphics();
                   // clear the screen
                   g.setColor(Color.black);
                   g.fillRect(0,0,480,480);
                   // render our game objects
                   g.translate(0,0); //placing the map to desired location on the frame
                  map.paint(g);
                   player.paint(g);
                   // flip the buffer so we can see the rendering
                   g.dispose();
                   strategy.show();
                   // pause a bit so that we don't choke the system
                   try { Thread.sleep(4); } catch (Exception e) {};
                   long delta = (System.nanoTime() - last) / 1000000;
                   last = System.nanoTime();
                   for (int i=0;i<delta / 5;i++)
                        logic(5);
                   if ((delta % 5) != 0)
                        logic(delta % 5);
         public void logic(long delta) {
              // check the keyboard and record which way the player
              // is trying to move this loop
              float dx = 0;
              float dy = 0;
              if (left)
                   dx -= 1;
              if (right)
                   dx += 1;
              if (up)
                   dy -= 1;
              if (down)
                   dy += 1;
              // if the player needs to move attempt to move the entity
              // based on the keys multiplied by the amount of time thats
              // passed
              if ((dx != 0) | (dy != 0))
                   player.move(dx * delta * 0.0015f,dy * delta * 0.0015f);
         public void keyTyped(KeyEvent e) {}
         public void keyPressed(KeyEvent e)
              if (e.getKeyCode() == KeyEvent.VK_LEFT)
                   left = true;
              if (e.getKeyCode() == KeyEvent.VK_RIGHT)
                   right = true;
              if (e.getKeyCode() == KeyEvent.VK_DOWN)
                   down = true;
              if (e.getKeyCode() == KeyEvent.VK_UP)
                   up = true;
         public void keyReleased(KeyEvent e)
              if (e.getKeyCode() == KeyEvent.VK_LEFT)
                   left = false;
              if (e.getKeyCode() == KeyEvent.VK_RIGHT)
                   right = false;
              if (e.getKeyCode() == KeyEvent.VK_DOWN)
                   down = false;
              if (e.getKeyCode() == KeyEvent.VK_UP)
                   up = false;
         public static void main(String args[])
          new Game();
    2) GameMap.java
    import javax.swing.*;
    import java.awt.*;
    import java.util.*;
    public class GameMap
         int width = 15;
        int height =15;
        static final int TILE_SIZE = 32;
             int[][]  A  =  {{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
                                 {1,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
                                 {1,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
                                 {1,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
                                 {1,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
                                 {1,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
                                 {1,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
                                 {1,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
                                 {1,2,2,2,2,2,2,2,2,2,3,2,2,2,1},
                                 {1,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
                                 {1,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
                                 {1,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
                                 {1,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
                                 {1,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
                                 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
        Image sea = Toolkit.getDefaultToolkit().getImage("res/sea.PNG");
        Image rock = Toolkit.getDefaultToolkit().getImage("res/rock.PNG");
         public void paint(Graphics g)
            for(int across = 0; across < width ; across++)
                for(int vert = 0; vert < height ; vert++)
                    if (A[across][vert] == 1)
                    g.drawImage(rock,across*TILE_SIZE,vert*TILE_SIZE,null);
                         else
                         g.drawImage(sea,across*TILE_SIZE,vert*TILE_SIZE,null);
        public boolean blocked(float x, float y)
              return A[(int) x][(int) y] == 1;
    3) Player.java
    import java.awt.Graphics2D;
    import java.awt.Image;
    public class Player {
         private float x;
         private float y;
         private Image image;
         private GameMap map;
         private float ang;
         private float size=0.3f;
         public Player(Image image, GameMap map, float x, float y)
              this.image = image;
              this.map = map;
              this.x = x;
              this.y = y;
         public boolean move(float dx, float dy)
              // new position
              float nx = x + dx;
              float ny = y + dy;
              //check collision
              if (validLocation(nx, ny)) {
                   x = nx;
                   y = ny;
                   // and calculate the angle we're facing based on our last move
                   ang = (float) (Math.atan2(dy, dx) + (Math.PI / 2));
                   return true;
              // if it wasn't a valid move don't do anything apart from tell the caller
              return false;
         public boolean validLocation(float nx, float ny)
              if (map.blocked(nx - size, ny - size))
                   return false;
              if (map.blocked(nx + size, ny - size))
                   return false;
              if (map.blocked(nx - size, ny + size))
                   return false;
              if (map.blocked(nx + size, ny + size))
                   return false;
              return true;
         public void paint(Graphics2D g) {
              int xp = (int) (map.TILE_SIZE * x);
              int yp = (int) (map.TILE_SIZE * y);
              // rotate the sprite based on the current angle and then
              // draw it
              g.rotate(ang, xp, yp);
              g.drawImage(image, (int) (xp - 16), (int) (yp - 16), null);
              g.rotate(-ang, xp, yp);
    }

    rotate() should always be accompanied with appropriate translate().
    See:
    http://java.sun.com/docs/books/tutorial/2d/TOC.html
    http://www.adtmag.com/java/articleold.aspx?id=1241
    http://www.apl.jhu.edu/~hall/java/Java2D-Tutorial.html
    And, never mix AWT components with Swing ones.
    Use JPanel instead of Canvas.
    Use also standard drawing/painting technique shown above URSs.

Maybe you are looking for

  • Can i backup my ipad to a drive another than c:/drive

    I have a windows computer but my c:drive is nearly full. Can I change the backup location to another drive.

  • Uploading Vendor invoices with BAPI_ACC_INVOICE_RECEIPT_POST

    I am working on putting together a program that will allow  users to upload invoices from a spreadsheet into SAP using BAPI_ACC_INVOICE_RECEIPT_POST. I realize that I will have to calculate the tax before feeding the information into the BAPI. My pro

  • Is it possible to boot up a 2014 macbook pro from a cd or usb?

    Hello everyone! I am thinking about buying a Macbook Pro ( latest version ), but I work on other operating systems like Linux and Windows (I use various distributions of linux).Would it be possible to boot a mac pro from an external disk unit or a US

  • Should arch symlink /usr/lib64 to /usr/lib?

    After spending two hours debugging a bloody java applet accessing a smart card trough pcsclite (Buypass used for different services in Norway, including  government services) it turns out it failed because it ONLY looked for 64bit libs in /usr/lib64.

  • Merging data from multiple BAPI tables

    Hello, I'm executing a BAPI_XX_GETLIST with multiple "Tables" selected with the REQUESTEDTABLESX import parameter. What is the best way to combine/merge data from multiple "Tables" and bind them into a single webdynpro UI Table? Thanks.