Skip to main content
GameDev.net gamedev.net
🔒 Locked

Untitled

Started by bargasteh Jun 20, 2004 at 8:18 PM 6 replies 900+ views
Original Post
bargasteh
bargasteh
Hello again every body I have a question to ask here. Is there any body who knows, how I can convert a OpenGl geometry code with texture(basically OpenGL) to 3D studio Max? Is it even possible ? If yes is there any technique or is there any program or utilities? Thank you
OpenGl + C++
fyhuang
fyhuang
Hmm, I believe that it should be possible. Here is one way that I can think of:

1) DO NOT include OGL headers.
2) Create function prototypes for all OGL functions.
3) In each of the 'fake' OGL functions, put code that will translate the function call into a 3DS MAX 'data' whatever.
4) Once all data is collected, write it to the file.

I'm not sure exactly how to implement it -- I am not familiar with the 3DS MAX format. However, if you look it up (wotsit.org?), you should be able to write a simple converter.

AFAIK, there are no known utilities out there to perform the task you want.
- fyhuang [ site ]
_DarkWIng_
_DarkWIng_
Well, you can't directly create .max files becouse the file structure is not publicly avabile. You'll have to save in something 3dsMax can import from (like .3ds or simmilar).

Then you need something to intercept gl calls and transfor data sent to gl, to something you find usefull. You might want to check out utils called glInterceptor and glTrace that do something simmilar.

But getting all this to work will be quite a project. May I ask what are you trying to do with this?
You should never let your fears become the boundaries of your dreams.
aaron_ds
aaron_ds
Better yet, export it to a custom file format. Reletively easy.
Then use MaxScript to import the file. VERY easy.
Your export and import code should be very similar.
MaxScript is extremely easy to use. It took me an hour to writeup an exporter (first time I ever wrote anything with maxscript)
After I used MaxScript for the first time I finally realized why max is used so extensively in game creation, its plain easy.
bargasteh
bargasteh
Hello and thank you aaron_ds,_DarkWIng_,fyhuang.

Sorry I am a bit late to reply.
I am working on a project (for myslef) that can create a 3d model out of 4 2d pictures.
well yes its really good and my program does work (can create this model from 2D pic).
what I need to do now is port this model into *.3ds so I can apply lighting, etc
If anybody wants to help me let me know, the project that I am doing is my biggest project that I have ever done (doing).
well I am in initial stage (working on in for last 3 months) and I am hoping to finish it within a year.
hopefuly this project will be the first in its kind.
this question that I asked is just a small part of this project.
well send me email on bargasteh@aol.com and let me know if you are intrested to help me.
I will post few other questions in next few days. :)


OpenGl + C++
fyhuang
fyhuang
Intelligently converting 2D images into a 3D model? That's something that I fantasized about when I was less experienced. Sounds kind of, ah, difficult to me. Complex image processing is not my strong suit.

'Convert to 3DS to apply lighting'? Do you mean like lightmap lighting or do you mean real lights? OGL does have lighting capabilities.

If you really need to convert your data to 3DS, what I would do is port your program to MAXscript (or something that runs inside of 3DS MAX) and run it that way, so you wouldn't have to do any conversion. An alternative would be to, instead of doing whatever you're doing, convert your images into structures:

class CVertex
{
float posx, posy, posz;
};

That shouldn't be very difficult:

glVertex3f( x, y, z );

=

CVertex( x, y, z );

Assuming that you setup your constructors and all that. Good luck with your project!
- fyhuang [ site ]
_DarkWIng_
_DarkWIng_
Quote:
Original post by bargasteh
I am working on a project (for myslef) that can create a 3d model out of 4 2d pictures.
...
hopefuly this project will be the first in its kind.

Sorry, but there are products out there that can do this :) I don't remember the name, but we were playing with them in out CG class. You just took a couple of pictures of building and placed a control points on them, conected them a bit and it created a 3d model of it. Not a perfect thing but a nice toy.

Well, since you have data stored in your program, why not just use it in program (display it using opengl). Do you need to export the model? If so then export it to something simple like ASE (3dmax ASCII) or .x
You should never let your fears become the boundaries of your dreams.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.