OO Graphic Engine, how to add Rotation?

I'm trying to program a simple GameEngine, so far I've created a gameloop (doing stuff, render stuff and wait)
Now I want to add to the rendering process a way to rotate every single object with a different angle
my object would looke like this:
public class GameObject {
     double angle;
    public int x,y;
    public Image picture;
    public MOB(Image pic, int x, int y, double angle) {
              this.picture=pic;
              this.x = x;
              this.y = y;
              this.angle = angle;
}and my graphic engine should now paint those objects (pictures) at x/y and rotated, and there lies my problem.
how can i rotate the objects without rotating the whole panel? do i have to use a buffered image?
and last but not least, is this method efficient?
thx for helping
Ghley

Take a look at the AffineTransform class and the Graphics2D methods rotate, scale, translate etc. Worry about efficiency if you come up against a performance issue. Micro-optimization seldom helps, and can sometimes be deleterious.
a way to rotate every single object with a different angleThe method create (inherited from Graphics) can be useful here.
Remember that angles in Java are in radians, not degrees. The Math class has a static method that could be useful there.
db

Similar Messages

  • How to add an icon to a node in network graphics?

    Hi all,
      Do you know how to add an icon (any SAP' icon) to a node in network graphics?
    Just like a tree can have a leaf with icon (for example, a person icon, a plant icon), can a node in network graphics have an icon also?  and how to implement in network graphics?
      I already studied t-code gral: NETZOCX1
    NETZOCX2
    NETZ_BO1
    NETZ_BO2
    NETZ_BO3
    But no actual output.
    It seems using node type in network graphics can help to determine different icons, could you give some suggestion or examples?
    Thanks a lot!!

    Hi,
      Thanks for you link about SAP Graphics Framework. It seems not very useful in our case.
      Since we are using Control Framework now, there is Tree and Networks in it. Can a node in a network have an icon (such as person icon, plant icon)? I know a leaf in a tree in Control Framework can have an icon.
      Anybody has comments or suggestion?
      Thanks!

  • How to add abap stack to existing NW Java engine- for XI installation

    Hi All,
    I am having a netweaver Java Stack installed on my system. I would like to install XI - in order to install Xi ,I guess the system should be ABAP + Java. But since I am having java based engine, I would like to add ABAP stack to it. So, my question how to add an ABAP stack to already existing JAVA/J2ee engine.
    So what this process is known as-- Is it upgrading or New Installation. Because I need the guide and CD's for it.
    Can any one tell me which Guide(Install/upgrade/Master) wud help me.
    Thanks
    S

    Hi
    check the link www.service.sap.com/instguides>SAP Netweaver 7.0>installation guides there you can find what is the process which involves in installing ABAP+JAVA with PI
    Regards
    Uday

  • How to add a graphic watermark that is bigger than the photo?

    How to add a graphic watermark that is bigger than the photo?
         Basically I want to add a watermark that is a border, like "outside stroke" so that it doesn't clip the photo.
         Upper, left and right side are 10px and on the bottom is my signature that is 40px high. I know how to do this in Photoshop, but can't figgure it out in Lightroom.
         The inset function with negative numbers doesn't work, because it only export to the size of the exported image, instead it should resize the image with those 10px up, left and right and 40px on      the bottom.
    My bordes look like this either one of the two can be used, and if you scroll down you will se how the end result should look like.
    And below is what it should look like, so that Lightroom doesn't clip the photo.

    Are you sure the focus of your piano roll is on the right track? Are you zoomed in/out enough?

  • How to add a search engine to Chrome on a Mac?

    Hey there. I was wondering how to add search.disconnect.me to a search engine choice in Google Chrome on my mac. It looks like the instructions differ, and I have has good expearence inthe past with this help. Thanks in advance.
    CB223
    P.S. I am NOT using Safari. It is horrible. Do not ask.

    I have never used that search engine but in Chrome go to settings, manage search engines and at the bottom of that panel click on add.

  • How to add a search engine manually to Firefox. (No, not via add ons)

    How to add a search engine manually to Firefox?
    For example, what should I do add a custom search engine? It is not available via add-ons. When I go to the search page, Firefox doesn't detect it and it doesn't prompt me or allow me to add it as a search provider. I am looking for options similar to that in Chromium browser.
    let's say for instance, if I want to add redhat bugzilla to my search providers, I can go to search settings and just add https://bugzilla.redhat.com/buglist.cgi?quicksearch=%s
    Is there any similar option available in Firefox?

    I use these;
    '''[https://addons.mozilla.org/en-US/firefox/addon/add-to-search-bar/ Add to Search Bar]''' {web link}
    Make any pages' search functionality available in the Search Bar
    '''[https://addons.mozilla.org/en-US/firefox/addon/context-search/ Context Search]''' {web link}
    Expands the context menu's 'Search for' item into a list of
    installed search engines, allowing you to choose the engine
    you want to use for each search.
    '''[https://addons.mozilla.org/en-US/firefox/addon/searchthissite/ SearchThisSite]''' {web link}
    Allows you to search the website currently viewed with
    the website's internal search engine (and not the default
    FF search engine or an external engine)

  • How to add a search engine  like What do you love of Google ?

    how to add a search engine  like What do you love of Google ? I use Glims but it doesn't work or I don't know how to go about it
    Thanks

    You can also add any search engine not already listed in Glims by using the method described here:
    http://www.machangout.com/tutorials/addsearchengine
    Just enter the name you give the search engine in the name field, and the URL for it in the Query URL field.

  • RE: how to add attributes in graphical modulator in segment builder .

    Hi Gurus,
    can you please help me how to add attributes in graphical modulator in segment builder in sap CRM 7.0 WEB-UI.
    thanks and regards
    satyanarayana
    Edited by: koradasatya on Oct 27, 2011 8:14 PM

    Hi Gurus,
    thanks for your reply my requirement from client is given below if you could answer this it will be a great help for me.
    WKSC needs to be able to make selections (in segment builder) with the possibilities to use stored data on organizations. The information we are missing in Segment builder (SB) (and Account search for industrycode) are Industrycode (we want to see values not codes) and responsible salesrep (values not codes).
    These variables together with regions and other marketing attributes is crucial for us. Without it we cannot use the functionality built.
    We also need it so that we can extract smaller parts of our customers and prospects and update them with information from the thirdparty or adding new persons to them.
    Everyone using the SB should be able to use the fields for selections. i.e. Marketers, marketing managers and power users.
    Example
    We would like to make selections that could look like this.
    Region: A and B
    Organization in Industrycode C
    Sales rep: D, E, and F
    Turnover: above 50000
    CP on selected orgs
    CP has title G or H
    CP has Email not blank
    thanks and regards
    satya

  • How to add series to Business Graphics control dynamically?

    Hi Experts,
    How to add series to Business Graphics control dynamically?
    I tried the method add_series( ) but could not use it properly.
    If you have any clues of using it, let me know.
    I need it urgently.
    Best Regards,
    Arti.

    I'm not sure what ADD_SERIES method you are refering to. The only programable API for the Business Graphics that I found was this one:
    http://help.sap.com/saphelp_nw70/helpdata/EN/42/e61cd068dc3ee4e10000000a1553f7/frameset.htm
    I've not ever tried it, but you not just add the series UI element like any other dynamic UI manipulation during the WDDOMODIFYVIEW?
    http://help.sap.com/saphelp_nw70/helpdata/EN/11/ba74412cba127de10000000a155106/frameset.htm

  • How to Add a graphical Sequence panel  in a webhelp layout?

    Hi,
    Can anyone please let me know how to add a graphical pane on
    the top right of every topic which would show the flow of sequence,
    the single source layout being webhelp.
    I'll be more clear......
    If we click on Help>Tutorial>HTML ROBOHELP Tutorial. we
    see a panel on the right which shows the graphical flow of files.
    Can i do the same when i create a webhelp layout.(in html
    format)....Please Please Please let me know!
    Thanks
    Sincerely
    Siddb.

    Hi Siddb and welcome to our community
    What you see in the RoboHelp help file is a browse sequence
    as it is presented in a Compiled .CHM file. WebHelp and FlashHelp
    do not offer this type of a browse sequence. Instead, they use
    little Previous and Next arrows that sit just above the Table of
    Contents/Index/Glossary/Search in that little toolbar.
    Cheers... Rick

  • How to add Custom Search Engines to Search Bar

    In the past I managed to add a 'Custom Search Engine' to Firefox's 'Search Bar' (Windows Version) by just right-clicking that site's own 'search bar' and choosing 'Add to search bar'. I had no third party plugin installed to do this. It was provided by Firefox itself.
    Or am I mixing up this feature with Google's 'Add Custom Search Button' ?
    Anyhow, is there a way to add a 'Custom Search Engine' to Firefox's 'Search Bar' from any website, WITHOUT having to:
    * install an add-on (like: Add to Search Bar 2.0)
    * acquire search engines on 'mycroft.mozdev.org'
    * acquire search engines from 'Manage/Add Search Engines' from the drop-down menu in the search bar ?
    Thanks!

    Just made this [http://www.tobtu.com/customsearch.php custom search creator] to do this since I couldn't find one either.
    Although I wouldn't trust a stranger so here's the hard way:
    Install Apache (lamp/wamp whatever) or get free web hosting from some site.
    blah.html:
    <a onclick="window.external.AddSearchProvider('http://localhost/blah.xml');">blah</a>
    blah.xml:<br />
    <br />
    <pre><nowiki><?xml version="1.0" encoding="UTF-8"?>
    <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
    <ShortName>Blah</ShortName>
    <Description>Blah blah</Description>
    <Image width="16" height="16">data:image/png;base64,BlahBlahBase64AndUriEncoded%2B%2F</Image>
    <Image width="16" height="16">http://blah/OrJustAUrl.png</Image>
    <Url type="text/html" method="get" template="https://blah/?blah={searchTerms}"/>
    </OpenSearchDescription></nowiki></pre>
    Now go to http://localhost/blah.html and click the link.

  • How to add silver front panel theme for labview 2010

    how to add silver front panel theme for labview 2010

    Mahisnair wrote:
    yes i had tried this way but the vi built with silver theme doesnt look good in 2010 :-(
    wish if there was a way to include silver theme in 2010
    The only way I see to make it like that would be to recreate the theme in LabVIEW 2010 with external bitmap objects. Unfortunately it won't be as functional as the silver controls in various terms such scaling (bitmaps scale very badly) or transparency and click through functionality (a bitmap assigned to a control part will always catch all clicks and never allow a click to pass through anywhere to a lower layered part).
    The silver controls are using special internal graphic objects that were added in LabVIEW 2011, so recreating silver controls with the same functionality in earlier LabVIEW versions is impossible.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to create a job card and how to add waranty card in sales order

    I have one scenario for CS.the scenario is realted to automotive industry. Basically its a trading industry of HCV,MCV,LCV apart from that they will do servicing also. First the customer comes for a service.he is having free services. he will have waranty for spare parts of the vehicle. once he comes for servicing first the executive will take complains from the customer after that a Job card will be issued to the customer. there his chasis no ,engine no and registration no will be there. once enter the chasis no entire customer details has to come. how many free services he is having for how many kilo meters.then job card will go to the spare parts dept.that dept will issue the spare parts.then they will invoice the customer. he will pay the payment.and finally the gate pass will be given to the customer to deliver the vehicle.
    painful area is how to create a job card and how to add waranty in sales order.
    Regards,
    Venkat

    Hi,
    Have u resolved it then Please let me know !!! It is a very interesting problem and owuld like to know the solution...
    Regards
    Krishna

  • How to add a gradient or 50% transparent fill to an .ai imported path?

    Hello All;
    I need some help. My task sounds simple enough but not sure how to accomplish it.
    I created the following path in Illustrator (See attached illustration - the top one). This is actually for a lower-third graphic.
    I have been successful at importating that into .ai. Though should I be using a solid or a shape layer or doesn't it matter ?
    I can add a stroke which affects the color and thickness of the outlines OK.
    However, I can't figure out how to add either a gradient fill or one that is 50% transparent ? Can anyone help ?
    Oh ... I'll mention I'm using After Effects CS3.
    Thanks.
    Tim

    Rick;
    I've used Illustrator for quite a while both at home and at work but I really havn't had to do anything that complex yet. Same goes for Photoshop. I bought DVD tutorials for most of the productivity software I use and when you gave your first explanation, I watched the DVD tutorial on Importing into AE so I know what you're referring to when you say to import as composition. So far, I've only tried to import into AE by copying and pasting. I think that's why I just got the path and not the background. I'll try importing a composition shortly and see if I get the fill too. I actually found a tutorial on making the type of shape I need to in Photoshop so maybe I'll try that instead of Illustrator and then import that into AE.
    Btw - It may not actually be a gradient fill I need to use but instead a solid fill with the top half lighter and buttom half darker.
    In case you're interested, here's actually what I'm trying to create for a video project. I could actually buy the animation for $8 but I figured that this can't be that difficult and I need to learn this stuff anyway ... http://videohive.net/item/lower-third-15-different-colour-schemes/145337?WT.ac=category_th umb&WT.seg_1=category_thumb&WT.z_author=berol
    Tim

  • How to add entire new row at the top of table in pdf report from c# windows forms using iTextSharp

    Hi for past 3 days i was thinking and breaking my head on how to add entire new at top table created in pdf report from c# windows forms with iTextSharp.
    First: I was able to create/export sql server data in form of table in pdf report from c# windows forms. Given below is the code in c#.
    using System;
    using System.Collections.Generic;
    using System.Configuration;
    using System.Text;
    using System.Data;
    using System.IO;
    using System.Data.SqlClient;
    using System.Windows.Forms;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    namespace DRRS_CSharp
    public partial class frmPDFTechnician : Form
    public frmPDFTechnician()
    InitializeComponent();
    private void btnExport_Click(object sender, EventArgs e)
    Document doc = new Document(PageSize.A4.Rotate());
    var writer= PdfWriter.GetInstance(doc, new FileStream("Technician22.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(7);
    table.TotalWidth=585f;
    table.LockedWidth = true;
    PdfPTable inner = new PdfPTable(1);
    inner.WidthPercentage = 115;
    PdfPCell celt=new PdfPCell(new Phrase(new Paragraph("Institute/Hospital:AIIMS,NEW DELHI",FontFactory.GetFont("Arial",14,iTextSharp.text.Font.BOLD,BaseColor.BLACK))));
    inner.AddCell(celt);
    Paragraph para = new Paragraph("DCS Clinical Report-Technician wise", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK));
    para.Alignment = iTextSharp.text.Element.TITLE;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(95f, 95f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn=new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select t.technician_id,td.Technician_first_name,td.Technician_middle_name,td.Technician_last_name,t.technician_dob,t.technician_sex,td.technician_type from Techniciandetail td,Technician t where td.technician_id=t.technician_id and td.status=1", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("ID");
    table.AddCell("First Name");
    table.AddCell("Middle Name");
    table.AddCell("Last Name");
    table.AddCell("DOB" );
    table.AddCell("Gender");
    table.AddCell("Designation");
    while (dr.Read())
    table.AddCell(dr[0].ToString());
    table.AddCell(dr[1].ToString());
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString());
    table.AddCell(dr[4].ToString());
    table.AddCell(dr[5].ToString());
    table.AddCell(dr[6].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(inner);
    doc.Add(table);
    doc.Close();
    The code executes well with no problem and get all datas from tables into table in PDF report from c# windows forms.
    But here is my problem how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
    As the problem i am facing is my title or Header(DCS Clinical Report-Technician wise) is at top of my image named:logo5.png and not coming to it's center position of my image.
    Second the problem i am facing is how to add new entire row to top of existing table in pdf report from c# windows form using iTextSharp?.
    given in below is the row and it's data . So how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
    as you can see how i create my columns in table in pdf report and populate it with sql server data. Given the code below:
    Document doc = new Document(PageSize.A4.Rotate());
    var writer= PdfWriter.GetInstance(doc, new FileStream("Technician22.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(7);
    table.TotalWidth=585f;
    table.LockedWidth = true;
    Paragraph para = new Paragraph("DCS Clinical Report-Technician wise", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK));
    para.Alignment = iTextSharp.text.Element.TITLE;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(95f, 95f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn=new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select t.technician_id,td.Technician_first_name,td.Technician_middle_name,td.Technician_last_name,t.technician_dob,t.technician_sex,td.technician_type from Techniciandetail td,Technician t where td.technician_id=t.technician_id and td.status=1", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("ID");
    table.AddCell("First Name");
    table.AddCell("Middle Name");
    table.AddCell("Last Name");
    table.AddCell("DOB" );
    table.AddCell("Gender");
    table.AddCell("Designation");
    while (dr.Read())
    table.AddCell(dr[0].ToString());
    table.AddCell(dr[1].ToString());
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString());
    table.AddCell(dr[4].ToString());
    table.AddCell(dr[5].ToString());
    table.AddCell(dr[6].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(table);
    doc.Close();
    So my question is how to make my column headers in bold?
    So these are my questions.
    1. how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
    2. how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
    3.how to make my column headers in bold?
    I know that i have to do some modifications to my code but i dont know how to do it. Can anyone help me please.
    Any help or guidance in solving this problem would be greatly appreciated.
    vishal

    Hi,
    >>1. how can i align Title(DCS Clinical Report-Technician wise) center of pdf report with image named:logo5.png immediately coming to it's right?.
    2. how do i add the given below row and it's data to my top my table in pdf report from c# windows forms using itextsharp?
    3.how to make my column headers in bold?<<
    I’m sorry for the issue that you are hitting now.
    This itextsharp is third party control, for this issue, I recommended to consult the control provider directly, I think they can give more precise troubleshooting.
    http://sourceforge.net/projects/itextsharp/
    Thanks for your understanding.
    Regards,
    Marvin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • My itunes wouldn't open so I uninstalled it.  When I tried to reinstall I got "apple mobile device" failed to start.

    My itunes would not open so I uninstalled it.  When I tried to reinstall it I got an error message.  The message says Service "apple mobile device" (apple mobile device) failed to start.  Verify that you have sufficient priviledges to start system se

  • Date formatting in EVDRE reports

    Hi, some of the properties in my account dimension are dates (this is an invoice report). In the EVDRE report, these are shown using EVPRO. However, no matter what the formatting is set to in the dimension (number, date), in EVDRE they ONLY show up a

  • Pre-compile for the interactiveform in AP server

    Dear all, My dynpro application has a function for outputing a PDF document in the new form. When first creating, it takes time too long until timeout. However, after first time creating, every thing works fine. Can anyone has any suggestion for this

  • Data lost in Weblogic 6.0 web server cluster

    We developed a system using JSP+Servlet+Weblogic 6.0. We use web sever cluster provided by weblogic 6.0. We implemented a business logic to login user data. Because data user has to input is too much, there are multiple pages for user to login data.

  • Printing envelope with Lexmark X204n

    When I attempt to print a No 10 envelope from my Mac running Mavericks and Pages 5.2 to my Lexmark X204n the print job is mis-aligned. The Lexmark's manual feed tray centers the envelop to the printer, but envelope is printing as if it should be on t