View Full Version : convert C4D models into Open GL source code
Mike Abbott 05-08-2003, 05:52 PM Hi all,
I've got a client who wants me to produce some models that he then wants to 'convert into Open GL source code' for incorporation into a software product they are authoring.
I know nothing (OK: less than nothing ;)) about 'converting into Open GL source code'. Can anyone outline how this is done, or point me in the direction of some helpful 'newby' information?
Initial questions are:
Can I do this with textured C4D models?
Do I need some software tool to do this (I guess so)?
Is there an OpenGL 'model format' of some form - would this be what my client would be expecting?
...I'd just like to get a short briefing before I stagger blindly into the unknown... ;)
Thanks,
Mike A.
|
|
cookepuss
05-08-2003, 07:17 PM
I've got a client who wants me to produce some models that he then wants to 'convert into Open GL source code' for incorporation into a software product they are authoring.
Then their best bet isn't to convert it into OpenGL code. They may want to create a custom file import/export routine. OpenGL coded models have their advantages (mainly speed), but the trade offs are flexibility and bloat. Hard coding a model is usually most beneficial to newbies that don't know about import/export, imo at least. Custom data file formats allow for great compression as well as customization. Furthermore, a file is not dependent on any one display API.
With that said, products such as DeepExploration export to OpenGL source code. You'd have to first export the models out of the native C4D format though. It could be done by hand, but the idea of doing this with large models makes the task seem pretty unappealing. :)
I believe that a common limitation of automatic OpenGL conversion is that they merely change the data into "display lists". Display lists are about as inflexible as you're going to get in the OpenGL world. The prefered format, if there is one, is a compiled vertex array. It's the difference between sculpting in granite VS soft clay.
Can I do this with textured C4D models?
DeepExploration doesn't support the modern .c4d file standard. You'd have to convert the model out of c4d into a format that does support textures. Presumably, DeepExploration would allow for that in the OpenGL conversion process. Naturally, the software author would still have to supply the appropriate 2D image import routine.
Do I need some software tool to do this (I guess so)?
Again, DeepExploration should work, but I'd still suggest against hard coded models. You can find out more about DeepExploration here.... http://www.righthemisphere.com
Is there an OpenGL 'model format' of some form - would this be what my client would be expecting?
OpenGL is just an API. It's a high level interface to the low level video hardware. OpenGL just acts as the middle man, translating what you code into video output. That's all. There's no default "model format" to OpenGL. All model formats or import filters must be custom coded. If your client wants OpenGL code conversion then he's probably expecting some sort of rigid, hard to modify code. This is okay if he's only expecting something like hard coded primitive objects. For stuff like characters, or anything else that needs to be dynamic........ just avoid the direct conversion to OpenGL code. Bad idea. Not worth it.
Personally, I'd avoid conversion into code and just opt for the custom import/export filter. Of course that requires some planning on the part of the programmers. If all they want is to import C4D models then they might be best off seeing what Maxon supplies in the way of a file format specification. Otherwise, they'll have to import another format.
flingster
05-08-2003, 08:24 PM
maybe totally off on a tangent here...but i thought someone created an xml converter...if that was the case and opengl api accepted xml data...would this help...or the other party could use xml data instead...dunno...probably confused issue..but just a thought...xml export plugin is in resources thread>plugins i think!
sorry if i'm off track totally...
:shrug:
cookepuss
05-08-2003, 08:35 PM
You have to understand one thing. DirectX may have a native format, but OpenGL does not. There may indeed be an XML import routine, but it is not native to the OpenGL API or the SDK itself. For further clarification on what OpenGL can and cannot do, I refer you to either http://www.opengl.org or the OpenGL "Red Book".
File import and video display are two completely different issues. As I said earlier, OpenGL is really just an interface to the video display. OpenGL will handle on the actual viduo stuff like 3D points/lines/polys, HW specific extensions, transformation, blah blah blah. Any other non-display function that you require needs to be incorporated as additional code or libraries. This includes support for stuff like BMP, PNG, AVI, DXF, sound, input, etc..
flingster
05-08-2003, 08:53 PM
cheers...
was just a thought anyways to get data to opengl....but as you point out...don't bother unless its basic.
cookepuss
05-08-2003, 09:17 PM
For the intrepid, there's a SDK for 8.1 that allows for the creation of C4D file import/export filters. Check under "SceneSaverData" in the C4D SDK.
Mike Abbott
05-08-2003, 09:43 PM
Thanks Guys - that's useful info that's got me pointing roughly in the right direction. I can now go back to the client and ask him how he's thinking of handling this.
Thanks again,
Mike A.
CGTalk Moderation
01-15-2006, 02:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.