Archived

This topic is now archived and is closed to further replies.

i need the code to load a raw-file into an array (world[256][256])

This topic is 5807 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi i need the code to load a raw-file into an array (world[256][256]) and i need a rawfile for terrain 256*256 thanks

Share this post


Link to post
Share on other sites
There is no standard format for .raw files because they contain raw data. How they are interpreted depends on the software reading them.

An array (world[][]) of what? floats? ints? Vector structures?

Even if you reword your post to make it feasible, I doubt anyone will take you up on your ''offer''... I know I''m not going to go away and work for hours writing all the software needed to do what you want! What you''re asking requires a lot of work!

I suggest you go and do some more research into terrain engines. A common technique is to load a greyscale bitmap into memory and to displace points on a grid by the value of the bitmap. So you might say:

world[x][y].y = bitmapimage[x][y].color * k

Where k is a scalar value (Affects the overall height of the terrain). The above code assumes that world is an array of vector structures containing xyz floats and bitmapimage is an array of floats (?) and that the dimensions of world and bitmapimage are the same. Quite a lot of assumptions there, I leave the technicalities of implementing the above code up to you

That should be your starting point. Simple huh? Well from there things start to get more difficult



-------- E y e .Scream Software --------
----------------------------------------
                                  /-\
    http://www.eyescream.cjb.net | * |
                                  \-/
----------------------------------------

Share this post


Link to post
Share on other sites
hi i want to make a terrain and i have a raster of quads

without any height

the vertexes of these quads are
  

vertex3f(raster.x,"""searched""",raser.y);



and the """searched""" is a float array (world[][])

now i seach a way to make different landscapes

i saw the way to do this with raw files
but if there is a way to do this with bmp or so , it is good too.

but i dont want to do this with random.

now please seld me the code to fill the array with a "landscape"

Share this post


Link to post
Share on other sites