[Opensim-dev] terrain load-tile

Diva Canto diva at metaverseink.com
Tue May 27 02:46:34 UTC 2008


Yey! That totally worked. Thanks!

(That wiki page is 2 generations outdated. :-)

 

 

From: opensim-dev-bounces at lists.berlios.de
[mailto:opensim-dev-bounces at lists.berlios.de] On Behalf Of Nebadon Izumi
Sent: Monday, May 26, 2008 7:29 PM
To: opensim-dev at lists.berlios.de
Subject: Re: [Opensim-dev] terrain load-tile

 

Diva the command has changed now, you no longer specify size, but actually
how many regions
so it would be as follows : terrain load-tile synthetic.r32 2 2 999 999

hope this helps you.

Nebadon

On Mon, May 26, 2008 at 7:18 PM, Diva Canto <diva at metaverseink.com> wrote:

Hi,

I'm making a synthetic terrain of size 512x512, and I'm having trouble
loading it to a 2x2 region. I always get this:

18:55:53 - [Console]: Command [terrain load-tile synthetic.r32 512 512 999
999]

failed with exception System.IO.EndOfStreamException: Unable to read beyond
the

end of the stream.

I wrote the program that's generating the file synthetic.r32. It works well
when the file is of size 256x256 and is loaded into one single region.
However, for tiles, I always get the exception above.

The most important function is this, which was copied from the Terrain
module (slightly modified, names of vars mostly):

        public static void SaveFile(string filename, ITerrain map)

        {

            FileInfo file = new FileInfo(filename);

            FileStream s = file.Open(FileMode.Create, FileAccess.Write);

            BinaryWriter bs = new BinaryWriter(s);

            Console.WriteLine("Writing file... " + map.Length + "x" +
map.Width);

            int y;

            for (y = 0; y < map.Length; y++)

            {

                int x;

                for (x = 0; x < map.Width; x++)

                {

                    bs.Write((float)map[x, y]);

                }

            }

            bs.Close();

            s.Close();

        }

The Length and Width of map have the right numbers, i.e. in one case 256
and in the other 512.

The files have exactly the right sizes, in one case

-rwx------+ 1 Crista Lopes None  262144 May 26 19:09 synthetic.r32

and in the other

-rwx------+ 1 Crista Lopes None 1048576 May 26 19:16 synthetic.r32

Any ideas?? What else is the terrain loader trying to read?!

Thanks,

Crista


_______________________________________________
Opensim-dev mailing list
Opensim-dev at lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20080526/10e45e04/attachment-0001.html>


More information about the Opensim-dev mailing list