View Full Version : what does a .raw file contain?
05-12-2004, 02:02 AM
Hi am doing a hieght map, but am wondering what a .raw file contains, does it just contain a list of x,y,z coords and if so can i use any file and generate my own using random values???
A raw file usually just contains raw data. No headers or stuff to describe what's in there, just the data ready to be loaded. This means you have to know the layout yourself before you can load it, and the layout depends how it was saved.
If it's an image, it could contain the image data as unsigned bytes ordered in RGB trippes. If it's an image intended to be used as a height map, it could be floats representing height samples in a uniform grid, either saved in ascii of binary.
raw files can contain anything, in any format, usually without any information about the internal structure. This means YOU have to know the internal structure, like size of the image, format (float vs. integers, binary vs. ascii, and so on). If you don't know the exact internal structure of the raw-file you have, it's pretty much useless.
05-12-2004, 03:01 AM
so if i wanted to create a heightmap could i use a normal txt file, which contains x,y,z coords for each point???
as the .raw file i am using is the nehe tutorial, but oi get errors with the BYTE data type, it doesnt get recognised and wont work.
You can use whatever format you want. If you feel a text file with XYZ trippes is good enough for you, then go ahead and use it. It depends on what you need and what you're willing to pay to get it.
For a heightmap, a normal greyscale image usually works good, but as I said, it depends on what you need. The heightmap in NeHe's tutorial 34 is a normal 8-bit greyscale image representing height.
05-12-2004, 04:00 AM
when you say what you are willing to pay to get it, what do you mean??
Nothing is free, everything costs in one way or another. If you, for example, finds a file format that exactly fits your needs, but is extremely difficult to load, are you willing to spend lots of time to make a loader for that format? Or would you rather choose a less complex file format, but also make some changes in your design? When you have choosen a format, do you have the programs needed to create the files in that particular format?
The price you have to pay includes time spent making code to load the file, making changes to the design of your program to handle the file format, getting the programs needed to create the files, and so on.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.