-
Extracting cubic beziers from .OBJ files
Hi,
I'm trying to design my own 3d engine with cubic beziers patches being the primary primative (as opposed to dealing directly with triangles) and I'm pretty familiar with techniques like forward dfferencing to render the patches. My problem is importing geometry from standard file formats like .OBJ (.OBJ is one of a number of formats, but it seemed like the easiest and most common to start with). I've read the file format specifications that are posted on www.wotsit.org but most modelling programs store all curves as complex curves rather than nicely defined control points. What I would like to know is how to take that info out of the file and derive the control points from it and, in the case of more complex curved surfaces, how to break the curves up into smaller cubic patches. If anyone knows how to do this, knows of an example/tutorial, or knows of another file format that is easier for this please let me know. Any help would be greatly appreciated.
-Daedalus
-
Re: Extracting cubic beziers from .OBJ files
Daedalus
The best way to go about implemetning parametric surfaces into your program, would be to actually use the vertex information as the control points. This method would work best if implemented with bezier equations, I am unfamilier with how nurbs operate.
If you want to break up the curved surface into smaller groups, the .obj format breaks up all its triangle information into groups. Just seperate the groups into a smaller chunks.
I am unaware of any programs which export control point data, however their might be some.
-
-
Re: Extracting cubic beziers from .OBJ files
opps, please convert the wierd smiley ; graphics to semi-colons!
-joseph
-
Re: Extracting cubic beziers from .OBJ files
make that colons!
: to colons (i'm really sorry about this)
-
Re: Extracting cubic beziers from .OBJ files
Wow, thanks for the code Joseph. I changed all the faces into ':' and saves the file with a .ms extension. The only problem is that when I load up 3dsmax 3 and try to load the script nothing happens. I don't get any errors, but I also don't get any extra options under "save as" or "export". I have no experience with Max Script, so I have no idea what could be wrong. You wouldn't, by any chance, have any pointer on what I might have done wrong would you?
-Daedalus
-
Re: Extracting cubic beziers from .OBJ files
well, I think I might have found the problem. It looks as thought the face art erased more than just a ':'
test:
:-o

I'm trying to figure out exactly what set of characters is missing.
-Daedalus
-
Re: Extracting cubic beziers from .OBJ files
I made a link to the original script with instructions on how to intall it on my web site.
http://209.181.143.70/docs/NURBs.htm
-joseph
-
Re: Extracting cubic beziers from .OBJ files
Thanks a lot Joseph. I finally managed to get the script working. You were right about the .RTG file format too. It is easy to understand. I spent a while, before I got the script working, looking for the file format documentation on the net and couldn't find it anywhere. Luckily I didn't need it.
-Daedalus
-
Re: Extracting cubic beziers from .OBJ files
This is off topic but you should read this about ubb...
http://www.opengl.org/discussion_boards/ubb/faq.html
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules