Results 1 to 2 of 2
  1. #1
    Evan.C is offline Member
    Join Date
    Nov 2011
    Posts
    4
    Rep Power
    0

    Default 3D array to .txt

    Hello,
    I am currently making a 3D game for a computing project I am undertaking, but i am stuck on a problem I assumed to be easy.

    I will be having a couple of set maps the user can play on, and all objects and entities to be placed on the map will be given a x, y and z co-ordinate. Creating these co-ordinates as an array in java I can do easily enough, but then the problem I am having now, is I will want the data for the maps to be saved in a text file.

    So I am wondering how I am able to save a detailed array such as this in a txt file. I can write to the file and read from it no problem. But it is more, what will be saved in what order that is my problem.

    For example, and 2D array would be saved in a simple table in rows and columns, but then how would I save a 3D array in a easy format such as a table?

    The only way I have thought of, is having the data for x and z input into seperate tables for each y co-ordinate, which I think is simply unnecessary. So does anyone else have any suggestions?

    Sorry for any misunderstanding, I tried to make it as clear as possible,
    Thanks,
    Evan.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,883
    Rep Power
    25

    Default Re: 3D array to .txt

    all objects and entities to be placed on the map will be given a x, y and z co-ordinate.
    On Each line of the text file:
    object-id x y z

Similar Threads

  1. Replies: 0
    Last Post: 05-12-2011, 08:04 PM
  2. Replies: 23
    Last Post: 09-07-2010, 09:12 PM
  3. Replies: 2
    Last Post: 09-06-2010, 02:03 AM
  4. create a 2d char array from a 1D string array
    By jschmall12 in forum New To Java
    Replies: 1
    Last Post: 04-27-2010, 10:01 PM
  5. Replies: 1
    Last Post: 03-31-2009, 07:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •