Is there a model exporter plugin that writes C++ files?
-
@tig said:
Why do you need C++ ?
Because it would be quick and easy.
@unknownuser said:
If you search for exporters there are several Ruby-based ones - for DXF, OBJ, STL, KML, CSV, TSV etc as well as the built-in ones...
If you know the format you need and there isn't an existing one then see how it might be similar to an existing one and modify it... 'Binary' format files are NOT easy to write but 'text' based ones are...I don't need any specific format, I just need to be able to use the models in my C++ program and render them with OpenGL. I could start looking for C++ libraries that import collada for example, because that's built-in. But experience tells me, getting to know my way around a new library can be a lot of work.
-
@oricatmos said:
@thomthom said:
I don't quite understand the request.
You want a 3d model written as a C++ file?Yes.
@unknownuser said:
If so, would it not then depend in the data structure you use in your C++ app?
I would use the data structures the exporter gave me. All I really needed would be some arrays with vertex, face and normal data for the given model. Then I could easily render the models with OpenGL. Face colors would be nice, but not really neccessary.
If you got C++ skills then I'd think there'd be little work for you to write a small ruby script that exports the model data the way you want. Ruby gives you all you just mentioned. And then you could easily output it in the exact format you want.
-
I'm told, by someone that knows a lot about this stuff, that C++ is 10x faster (or so) than Ruby for exporting geometry.
-
@bigstick said:
I'm told, by someone that knows a lot about this stuff, that C++ is 10x faster (or so) than Ruby for exporting geometry.
I think there's a misunderstanding. I don't care whether the exporter is written in Ruby or in C++. I want the output to be C or C++ that I can compile in my C++ project. But since there doesn't seem to be an exporter like that, I'll have to write my own.
-
You want the model to output as a text file that happens to be in C++ syntax, right? That is simple enough if you know C++, and you have your own syntax your are trying to tie into. But no one else would be able to write it for you very well, since no one else knows exactly how you would want to handle the C++ file structure.
OBJ is just a text file, for example. Why not just learn how to parse their structure instead of making up your own file structure?
-
I'm sure there is a very simple light weight OBJ importers in C++. Such a common format.
-
@chris fullmer said:
You want the model to output as a text file that happens to be in C++ syntax, right?
That was the idea, yes.
@unknownuser said:
That is simple enough if you know C++, and you have your own syntax your are trying to tie into. But no one else would be able to write it for you very well, sine no one else knows exactly how you would want to handle the C++ file structure.
I don't want anyone to write anything for me. I just wanted to know if there already was an exporter like this.
@unknownuser said:
OBJ is just a text file, for example. Why not just learn how to parse their structure instead of making up your own file structure?
Basically I wanted to save me the step of parsing an input file and just let the compiler do it. I just want to have two 3D models in my program, no more.
-
@thomthom said:
I'm sure there is a very simple light weight OBJ importers in C++. Such a common format.
Thanks for the suggestion, I will have a look into the OBJ format. I don't know much about 3D file formats so I wasn't aware that OBJ is very common.
-
Hey,
I just wanted to say that I'm using the Open Asset Import Library (http://assimp.sourceforge.net/) now to load my two models. It can do a lot more than I need but it's not that hard to use.
-
@oricatmos said:
Open Asset Import Library
Thanks, I was not aware of this library, but it looks like a nice thing.
Advertisement