Trouble creating a landscape ! Please help!!

Hi,
In my project I have to input a 2D map of a landscape (geographical map) and then turn it into a 3D image using java3D.
First I divide the map into grids. And in the 2D plane , for each point (x ,y) I calculate the RGB value, using "image.getRGB(int x,int y)" . I have succeeded up to this.
Now I need to convert this RGB value of each point into a "height" , so that I can use them in the Point3f array and then creat the 3D view.
I'm using this idea because geographical map colors are refering to their height.
My problem is how to convert this RGB value into a height.
Any idea?Any algorithms?
Thanks in advance.

That depends a bit on the colour scheme of your sample maps- often people use a greyscale and you can just use darker or lighter areas to judge height, but if your source maps are using colours then you are going to work it out for yourself- perhaps you could build a half-way point application that loads in the map and displays the image and the rgb values for each grid point- you could use this to train your system as to what the appropriate colours might be or to find a way of mapping the rgb values.

Similar Messages

  • I need to create Buttons dynamically Please Help

    I am currently developing a card game. I represent my cards as buttons. But as the player draws more cards from the deck I have to generate buttons dynamically at run-time. I could use arrays of buttons and store new buttons inside that arrays of buttons. But the only problem is I need ActionListener for each of my buttons. How do you create ActionListener for each different dynamically created buttons? Please Help.

    Here is my code. I just do not understand how to create those functions dynamically that functions different each time.
    Here is my code please take a look.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class run108{
    JButton setbutton;
    JButton ButtonUp;
    JButton ButtonDeal;     
    JButton slot1;
    JButton slot2;
    JButton slot3;
    JButton slot4;
    JButton slot5;
    JButton slot6;
    JButton slot7;
    cards[] card = new cards[55];
    public static void main(String[] argv)
         run108 startgui = new run108();
         startgui.createframe();     
    void createframe()
         //Standard of way of creating Frame
         JFrame frame = new JFrame("108");
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.setLocation(300,200);// Tells the startup position;
         //Adding Panels to the framework
         JPanel panelA = new JPanel();
         panelA.setBackground(Color.white);
         panelA.setLayout(new BoxLayout(panelA,BoxLayout.Y_AXIS));
         JPanel panelB = new JPanel();
         JPanel panelC = new JPanel();
         //Adding buttons with card images
         JLabel label1 = new JLabel("       Set of Cards");
         panelA.add(label1);
         ImageIcon pic1 = new ImageIcon("cards/backd.png");
         setbutton = new JButton(pic1);          
        panelA.add(setbutton);
        ImageIcon picdeal = new ImageIcon("cards/deal.png");
         ButtonDeal = new JButton(picdeal);
         panelA.add(BorderLayout.CENTER, ButtonDeal);
        ButtonDeal.addActionListener(new DealListener());
         JLabel label2 = new JLabel("       Your Target");
         panelA.add(label2);
         ButtonUp = new JButton(pic1);          
        panelA.add(BorderLayout.CENTER, ButtonUp);
        frame.add(BorderLayout.WEST,panelA);
        // Adds 7 initial card slots.
         ImageIcon pic2 = new ImageIcon("cards/backc.png");
         slot1 = new JButton(pic2);
        panelB.add(slot1);          
        slot1.addActionListener(new Slot1Listener());
        slot2 = new JButton(pic2);
        panelB.add(slot2);
        slot2.addActionListener(new Slot2Listener());
         slot3 = new JButton(pic2);
        panelB.add(slot3);
        slot3.addActionListener(new Slot3Listener());
         slot4 = new JButton(pic2);
        panelB.add(slot4);
        slot4.addActionListener(new Slot4Listener());
         slot5 = new JButton(pic2);
        panelB.add(slot5);
        slot5.addActionListener(new Slot5Listener());
         slot6 = new JButton(pic2);
        panelB.add(slot6);
        slot6.addActionListener(new Slot6Listener());
         slot7 = new JButton(pic2);
        panelB.add(slot7);
        slot7.addActionListener(new Slot7Listener());
        frame.add(BorderLayout.CENTER,panelB);
        // This has to be added @ the end to show the components
        //that were added after on. If it is placed before the components
        //the components shall not appear since they sit on the frame
         frame.setSize(600,500);
         frame.setVisible(true);
    class DealListener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot1Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot2Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot3Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot4Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot5Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot6Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot7Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    }

  • Trouble context in SQLJ (please help)

    Hi,
    I have a problem using "Oracle JDeveloper" as tool to compile sqlj programs.
    I have created a connection conn and I want to use this connection with a context. This is the code that I have writed:
    import java.sql.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import sqlj.*;
    import oracle.sqlj.runtime.*;
    import java.util.Vector;
    import sqlj.runtime.*;
    import java.math.*;
    import sqlj.runtime.ConnectionContext;
    public class Sqlj2 {
    public static Connection getConnection1() throws Exception {
    String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
    String url = "jdbc:Odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=c:/Oracle/Progetto.mdb";
    String username = ";UID=Roberto;";
    String password = "PWD=prova";
    Class.forName(driver); // load MySQL driver
    Connection conn = DriverManager.getConnection(url+username+password);
    return conn;
    public static void main(String[] args) {
    Connection connection1 = null;
    try {
    connection1 = getConnection1();
    #sql context Ctx1;
    Ctx1 context = new Ctx1(connection1);
    #sql [context] { SELECT id_dip,nome_dip,budget FROM Dipartimento WHERE budget > 1000 };
    } catch (Exception e) {
    e.printStackTrace();
    System.exit(1);
    } finally {
    try {
    connection1.close();
    } catch (SQLException e) {
    e.printStackTrace();
    In particular this peace of code give me a trouble:
    Ctx1 context =  new Ctx1(connection1);
    The word "Ctx1" is always red in JDeveloper!!!! I think I import all the classes that I need....
    How can I solve this problem?
    Can you try to run this code to look if the text is red in your compiler?
    Please help me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Thanks!!!
    Edited by: user1762560 on 2-dic-2008 10.41

    please answer me...it's very important...can you give me the name of another sqlj compiler?

  • Error while Creating sequence. Please help

    I'm using below script to create sequence but getting error
    Error report:
    SQL Error: ORA-01722: invalid number
    01722. 00000 - "invalid number"
    CREATE SEQUENCE BL_BTN_MASTER_SEQ
    MINVALUE 1
    MAXVALUE 999999999999999999
    INCREMENT BY 1
    START WITH (SELECT MAX(BULLETIN_MASTER_ID)+1
    FROM BL_BTN_MASTER)
    NOCACHE;
    FYI..Data type of bulletin_master_id column is NUMBER(22,0)
    PLease help.
    Edited by: user11228834 on May 29, 2013 10:22 AM
    Edited by: user11228834 on May 29, 2013 10:23 AM
    Edited by: user11228834 on May 29, 2013 10:25 AM

    Oracle doesn't like the "(select max(bulletin_master_id)+1 from bl_btn_master)' statement embedded in the CREATE SEQUENCE statement because if you look at the syntax it is expecting an acual number. You could use execute immediate to create the sequence this way:
    {code}
    declare
    v_seq number;
    v_statement varchar2(200);
    begin
    select max(bulletin_master_id)+1
    into v_seq
    from bl_btn_master;
    v_statement := 'CREATE SEQUENCE BL_BTN_MASTER_SEQ ' ||
    'MINVALUE 1 ' ||
    'MAXVALUE 999999999999999999 ' ||
    'INCREMENT BY 1 ' ||
    'START WITH ' || v_seq ||
    'NOCACHE';
    execute immediate(v_statement);
    end;
    {code}

  • Problem in creating DB Link - Please help

    Hi ,
    I created a DB Link with name "CTM_DBLINK".
    i want to create DB Link with different name but using same server and connection also same.
    When i am trying this its shows error :
    "ORA-00933:SQL Command not properly ended."
    My Query :
    create public database link "CTM_BANK"
    connect to ABC
    identified by <pwd>
    using 'database';
    i am getting error on line 3 : identified by <pwd>
    Please help , its urgent.
    Surender

    Try enclosing the password in quotes.
    Same problem occurs if you try to create a user using the password you have given.
    SQL> create user abc identified by abc!;
    create user abc identified by abc!
    ERROR at line 1:
    ORA-00922: missing or invalid option
    SQL> create user abc identified by "abc!" ;
    User created.
    To create the database link, try this:
    SQL> CREATE PUBLIC DATABASE LINK "CTM_BANK" CONNECT TO "ABC"
    2 IDENTIFIED BY "abc!"
    3 USING 'database' ;
    Database link created.
    Hope that helps!
    Regards.
    RK

  • How to create an array - Please help

    Hello. I have been trying to build a dynamic menu. According to different user role, they would have different access options to use the form. Now, I need to create a dynamic menu to display the menu options according to their user role. Somebody told me I can use an array, but I am not sure how to achieve this, and how to display the menu to user. Please help me. Thank you.

    Hi
    Arrays in Form are implemented through Record Groups. However you can enable and disable a menu item throught database roles.
    For more infor please refer Oracle Documentation.
    HTH
    Arvind Balaraman
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by scsyim:
    Hello. I have been trying to build a dynamic menu. According to different user role, they would have different access options to use the form. Now, I need to create a dynamic menu to display the menu options according to their user role. Somebody told me I can use an array, but I am not sure how to achieve this, and how to display the menu to user. Please help me. Thank you.<HR></BLOCKQUOTE>
    null

  • Internal software error cpp, line 214 - creating subtitles failed / please help

    Hello,
    it a pretty toutgh expierience trying to create my first dvd with Adobe,
    I have to hand it over this Friday, in some 12 hours,
    and there is another issue I have to cope with:
    1. I have the project ready, I check for errors and there are no.
    2. My project has 2 two timelines (movie and soundtrack) and subtitles in 7 languages. All already transcoded.
    3. I press build DVD.ISO and here comes the wonderful Adobe greeting: Internal software error. File Spec: cpp, line 214. I clik ok and the other window appears happilly informing me that creating subtitles failed. And creating of thesee subtitles was the only reason I started using Adobe Premiere Pro and Encore
    Could you please help me, I am going slightly crazy with it. How can I resolve this issue. I tried to look at the forum, but did not find the solution. Neither @ google.
    Best regards,
    Michal

    Thanks a lot Stan !
    I did two timelines, since I wanted to give the possibility to listen to the music track, without watching the movie. No idea if this could be done in one timeline (I am just starting my Adobe adventure .
    Coming to the point, I fixed it. Here is how:
    1. While building DVD the message was: Internal software error. File Spec: cpp, line 214. and creating subtitles failed.
    2. I tried to make really big spaces between subtitles, as well as change the fonts, the kerings, etc. - to no avail.
    3. I deleted all the subtitle text (marking it with the mouse and pressing delete), but leaving all the subtitle tracks, since I did not want to link them all again to the subtitle menu buttons.
    4. For each subtitle track I imported the subtitle text once again.
    And it worked! So simple if one already knows how to do it.
    Thanks for help anyway, you and others at this forum helped me a lot during the whole project (missing Encore library, baddriver.txt to mention the most critical issues).
    Best regards,
    Michal

  • Can't Create New File, PLEASE HELP!!!!

    Hello,
    I've been trying to read the previous forums on this topic and none of the advice has worked for me. I am running Photoshop 7.0 on Windows XP. It has been running fine for several years until this week.
    I ran the Spyder 2 Suite to calibrate my laptop and LCD monitor and now the problem has arisen. One of the software's requests was to disable Adobe Gamma so I deleter my Adobe Gamma Loader.exe file from the start up folder.
    As I went to create a new file in Photoshop, nothing would happen. The whole drop down menu for File was grayed out and I would have to Ctrl+Alt+Delete to get out of Photoshop. I then uninstalled and reinstalled Photoshop, as well as uninstalled the Spyder software and still can't create a new file.
    I checked and my Adobe Gamma Loader is back in the startup folder.
    I also tried deleting my printer and took down my firewall like other posts have listed but those also did not work.
    Please help!!!! I need to get back to some work asap!
    Thanks,
    Ryan

    try resetting your preferences per the faq:
    http://www.adobeforums.com/webx/.ef4a07f/1
    also make sure you're running ps 7.01 there were tons of bug fixes in that update over vers 7.0.

  • Having trouble installing itunes 7 PLEASE help!

    I"m having trouble installing my itunes 7. everytime i click download, nothing happens. the page just refreshes itself. i have tried it a million times and i'm afraid to uninstall and install itunes cause i wont be able to import my 6,000 songs again---most of the cds are scratched by now
    PLEASE HELP ME!!!!! I'm having withdrawal!!! My list of songs to buy is severly backing up!

    those symptoms can sometimes be caused by pop-blockers or web acceleration software.
    if you switch off all your pop-up blockers and/or accelerators, does the download start for you?

  • I'm having trouble installing my itunes please help.

    I've tried to upgrade my itunes now for like the 100th time and it hasn't worked. It will load the upgrades but they won't install. When I look in my downloaded updates folder the upgrades are there. When I click on them they will bring up the installer but then I get a message saying that the software cannot install because there is another download in progress. I'm stumped please help.

    Read here:
    http://support.apple.com/kb/ts3424
    However, 99.9% of the time, that error message means you're trying to activate a "hacked" iPhone...hacked to unlock it rather than it being "officially" unlocked. Apple's servers have detected such & are preventing your phone from being activated.

  • 10.4.6 Trouble... PLEASE HELP!

    Hey everybody,
    I went to install 10.4.6 yesterday and it downloaded and then an error popped up saying there was a problem with the install and the disk image was moved to the trash.
    I shrugged it off, figuring the partial install wasn't going to cause any harm. Now when I boot my computer the apple logo with the spinning wheel just sits there for like 5 min. and then it reboots and the startup chime starts again and it does the same thing but then finally boots up at like 1/3 speed. And its moved around all of my icons.
    I'm new to Macs ... just got a PowerBook right before MacBook Pro came out. I have no idea what to do as far as fixing everything. Please Help, Somebody!

    Definitely backup all your files first. See my FAQ here on backing up:
    http://www.macmaps.com/backup.html
    Secondly an archive and install from the original system discs restores the operating system to the version that is on those discs. As your Mac did not come with 10.4.6, any new application updates with 10.4.6 may not work well with the archive and installed version of the operating system, and a combo update back to 10.4.6 would be recommended, following these tips:
    http://www.macmaps.com/upgradefaq.html
    Finally, the combo update installs everything that was included in 10.4.1 through 10.4.5 updates in addition to 10.4.6 and the intermediate security updates. The delta update for 10.4.5, only installs the new things found in 10.4.6 update to 10.4.5, and hence only works on 10.4.5. Occasionally though I've seen combo updates work better on systems than delta updates, even though there logically should not be any difference.
    Disclaimer: Reference to links I make to my Macmaps.com website are a for your information only type reference. I do not get any profit from this page, and it is open to the public.

  • Ok i have a linksys WRT54G 2 and im having trouble sharing my media please help

    ok i set my pc to share media with my ps3/360 and it works fine but only when i plug my laptop into the router instead of connecting it wirelessly. if i connect it wirelessly my 350 and ps3 cant see my laptop but my laptop can still see them. i really like watching my videos on tv instead of computer and plugging this in whenever i need to do that is not an option please help. o and im not sure if it matters but im in vista.

    Try this and this link and check if you are able to resolve the issue.

  • Trying to create complicated script, please help!

    I work at a cell phone store where business is less than excellent. We have this nifty tool where i enter a customers phone number and zip code in and it tells me if the are eligible for a discount. So my boss wants me to type in a phone number, beginning with the prefix 208640, and 208641, and beginning at the end of 0000 and ending at 9999, and calling all customers who are shown as eligible, if a phone number and zip code combination does not match, the site will rout me back to the entry page, and if a phone number/zip match it will take me to a new page showing me the results... this sounds like a job for a computer, and I am not willing to put that much time and effort into a useless, remedial task for $9.00 an hour as store manager... Please help!

    Automator might be the wrong tool. For scripting queries, post to the AppleScript forum under OS X Technologies.

  • Trouble with the printer PLEASE HELP!!!!

    Hi,
    I was wondering if anyone could help me. I work at an elementary school and I was recently trying to set up one of our iMac computers with a new printer. The printer is a HP LaserJet 1320. I installed all of the drivers from the disk into the computer and it told me that I had to set up the printer in the "Desktop Printer Utilities" file. When I went to do that I found that there was no such file in the system. I was wondering if there was a way of getting the printer to work. And if so I need detailed instructions so that I can set up the printer properly for the teacher. PLEASE HELP
    Thank you very much!

    Hi, wacko179 -
    Welcome to Apple's Discussions.
    I believe they are referring to Desktop Printer Utility, which is a program, not a file. It is one of the standard OS 9 utility programs installed by default. Try doing a search on your hard drive for it - note that the spelling of its name is a bit different than the one you gave.
    If it is indeed missing, you can use the utility TomeViewer to extract (expand) any files you want from an Installation Tome on an OS 9.x Install CD or download disk image, without running the installer.
    How to use TomeViewer
    The item Desktop Printer Utility can be found in the Installation Tome located here on an OS 9.0.x Install CD - (CD) >> Software Installers >> System Software >> Mac OS 9 >> Installation Tome.
    Note that this requires the use of an original OS 9 disk named Software Install, or a retail OS 9.0 or 9.0.4 Install CD.

  • I am having trouble with my terminal please help..

    hey guys ,when ever i open terminal it always open with terminal bash 80X24 and after 10 secs it ends up with  "process complete" written on the terminal window.
    now please tell me what to do somedays before i was trying to install homebrew using terminal ..that day onwards  i m facing this problem.please help me guys .
    thanks is advance

    Sounds like maybe there is a broken shell initialization script
    Terminal -> Shell -> New Command... ->
    copy and paste this command into the new command dialog box and look at the results
    /bin/ls -l .bash_profile .bash_login .profile .bashrc
    You may get output such as:
    -ls: .bash_login: No such file or directory
    -ls: .profile: No such file or directory
    -rw-r--r--  1 raharris  staff  31561 Sep  5 18:13 .bash_profile
    -rw-r--r--  1 raharris  staff  58026 Nov 17 11:39 .bashrc
    If all 4 files come up No Such File or Directory, it is not a bad shell initialization file
    If you do have one of these files, such as my example .bash_profile, then you need to move it out of the way
    Terminal -> Shell -> New Command... ->
    copy and paste one of the following commands into the new command dialog box to move the selected shell initialization script out of the way
    /bin/rm .bash_profile saved.bash_profile
    /bin/rm .bash_login saved.bash_login
    /bin/rm .profile saved.profile
    /bin/rm .bashrc saved.bashrc
    repeat for each script was found the above 'ls' command

Maybe you are looking for