Hi, The question:
I was just wondering what kind of file format you guys use for your opengl projects? I have a lot of problems with this.
No C# support
What amazes me a bit is that there is so little C# support. OpenGL doesn't support anything from the box, so I figured I have to write my own file-reader. There are plenty of opensource projects for that in C++. But I have not seen any in C# so far. (In fact I searched on several sites like google and sourceforge.net, opengl.org,...)
A suggestion for a file format
So now I am writting some own data format that should look something like the following.:
Some advantages I see:
Well I think the advantages are obvious:
It's a simple format, easy to understand, no unncessary junk
Because it's XML based it's easy to parse from .NET
The structure fits the way it is going to be drawn. Textures will be declared first with the opengl functions "Texture = new OpenGLTexture2D(@"texture file"); " and next they will be painted face by face based on a drawingmethod specified in GlBegin(drawingmethod) followed by the vertexes.
Next problem:
The same problem remains! I still need to write a converter because my format will not be supported by any program. (Somebody suggested an Exporter for 3D Studio Max but that would be in C++ again. And I just don't know enough C++ to write something like that). So I am going to write a X3D converter now (X3D is some kind of XML-based VRML).
I can not imagine that I am actually the first person that is serious about writing OpenGL in C#. There must be somebody else that had the same problem? So, if you are that kind of person and are reading this, do not hesitate to let me know .
____________________________________________
Please rate my messages. Thank you!
____________________________________________
Bram Vandenbon http://www.bramvandenbon.com
Just wanted to add my classdiagram of it. . Lol, I finally got my VS2005 DVD yesterday and immediatly fell I love with those UML-like diagrams. My vacation started yesterday so this will probably be finished by the end of the week.
Last edited by BramVandenbon; Jun 22nd, 2006 at 03:41 PM.
____________________________________________
Please rate my messages. Thank you!
____________________________________________
Bram Vandenbon http://www.bramvandenbon.com
While you guys are trying to remember what filetype you used (for which I am very grateful ) ... I can let you know that my X3D converter is starting to work pretty well.
____________________________________________
Please rate my messages. Thank you!
____________________________________________
Bram Vandenbon http://www.bramvandenbon.com
Wow, great progress. Looks like it works really well. I've never usedd C# but I've been trying to learn OpenGL for C++ the past month or so, but haven't done much with it.
Thanks fatman. I wish you good luck with your C++ adventure in opengl. OpenGL is quiet challenge isn't it? It took me 5 years to understand it.
The first time I tried to do someting in 3D I tried directx5 in VB6 I think. But I didn't understand a thing of what I was doing. It had so many dll calls and commands I had no idea what they were doing. So, after a while I gave up
A bit later I tried again with directx6. I assumed that would have been simular. But it wasn't! everything was changed. And it was just as hard as the time before. I quit shortly after.
I retried with directx7.1 but it was just the same problem.
I bit later I wanted to give it another shot with directx8. Again everything looked different and I failed.
So, I a year later I retried with "managed" directx9 for C#. I downloaded this huge SDK. And it seemed that this trash was so slow that even the samples from the tutorials could not run on my computer at decent speed.
So instead I tried opengl. Because I was getting a bit used to directx, opengl seemed very different for me. I started to understand things better but a week later I gave up again because I didn't really know how to get from the ground. Also in opengl you can't load .x files (as in Directx). So pretty soon I gave up because I got tired of drawing just triangles and lines.
Years went by... I learned some more java and C#. I learned about inheritance, polymorphism, ... I learned all about design patterns and the model-view-control stuff. I did a supermario clone game. That all went flawless. And now I finally retried and it's really easy now.
Seems like I just was not ready for it at that time. Also I must have been a fool to try directx in Visual Basic 6. It's impossible to write a 3D engine in a language that is not even object oriented. That's just rubbish.
I really like all those tutorials out there that concentrate on drawing. But real beginners shouldn't start out with those tutorials. They should start out with making a paint-application or something like that. Something that redraws the screen by using a thread. I think that's why so many people (including me) fail several times before getting it. I think another reason why a lot of people fail, is that there is no standard function to load files. You can't expect a beginner to write all that stuff himself. And as long as you are not able to load files it's not going to get you far anyway.
If I were better at C++ I would do it in C++ for sure. That's really a big advantage you have (all those opensource projects)! But I only know the very basic of C++. So, I am cursed to use C# and java for the rest of my live
____________________________________________
Please rate my messages. Thank you!
____________________________________________
Bram Vandenbon http://www.bramvandenbon.com
The last days I've been puzzled with lightning effects. The following screenshot is a ball with 120 000 points that's turning around while there's a light pointed at it. The model was made in Blender (Free modeling software) and exported to X3D. Next I imported it and converted it to my own format. The X3D file did not contain information about the normals. That was a bit of a problem, because without normals you can not make lightning effects in opengl. To solve this I wrote a function to split every face into 4 triangles and calculate the normals for them by multiplying vectors. Quiet a challenge!
This makes it time to call this topic resolved! It's too bad there are so little opengl developers on this forum. I guess DirectX is a lot more popular? I wonder why though. From my personal experiences it's both harder and slower.
____________________________________________
Please rate my messages. Thank you!
____________________________________________
Bram Vandenbon http://www.bramvandenbon.com