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?

  • Take a look at the .obj model files they are essentially what you are looking for. – János Turánszki Sep 28 '14 at 20:54
up vote 5 down vote accepted

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.

  • That works! Thank you very much! – Gumptastic Sep 29 '14 at 14:12
  • Glad it helped. And thank you, @jhocking for the edit. – lvictorino Sep 29 '14 at 14:28

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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