I'm building a game engine in OpenTK (OpenGL for C#). Is it ossible to take a terrain mesh (in any format) and convert it into a text file (or a really small character-filled file, no more than a few bytes). Then, afterwards, I'd take that file and generate the terrain from it.

The only reason I'm doing this is to save some memory on the computer. I think it would be more efficient if we had to quickly generate a crude terrain, and then smooth it instead of loading in a large mesh file.

Is this possible, and if so, how could I do it?

  • \$\begingroup\$ Take a look at the .obj model files they are essentially what you are looking for. \$\endgroup\$ – János Turánszki Sep 28 '14 at 20:54

I think the obj file format is what you need. OBJ is pretty commonly used in 3D graphics, and it's a text file. You will need to walk through your mesh properties and write your own file. Then you'll be able to load and display it.

  • \$\begingroup\$ Glad it helped. And thank you, @jhocking for the edit. \$\endgroup\$ – lvictorino Sep 29 '14 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.