OBJ Importer/Exporter Plug-in Oddities

froo
Captain
Posts: 2552
Joined: 22 May 2009, 12:13

Re: OBJ Importer/Exporter Plug-in Oddities

Post by froo » 05 Jul 2011, 18:07

I still have to look at the code, but it appears both the
exporter and importer are performing a 'flip', since WorkSpace
is a left-handed coordinate system.
I'll have to check my code and comments, notes, conversations,
etc. because, I recall I had this concern for awhile, about
handedness, and how to deal with it. I may very well have
mis-handled it. It may be, that dealing with handedness is not
necessary at all. Another possibility is to see if I can determin
the 'winding' of the vertices, prior to processing. The winding
will tell me the handedness. I'll get it done. :ugeek:

pugman 1
Captain
Posts: 1537
Joined: 21 May 2009, 19:26
Type the number ten into the box: 0
Location: Germany

Re: OBJ Importer/Exporter Plug-in Oddities

Post by pugman 1 » 05 Jul 2011, 18:59

Hi froo,when you have this sorted iwould like to get it.dont make yourself
crazy with it like you do with your triangles :D

froo
Captain
Posts: 2552
Joined: 22 May 2009, 12:13

Re: OBJ Importer/Exporter Plug-in Oddities

Post by froo » 05 Jul 2011, 23:56

Sounds good pugman.
I scanned through the code to remember what I was doing, and why.
There were some problems with the triangle count being correct, while
the data was being imported. I still don't know why this was the case.
But, if I loaded the triangles in the reverse order to the triangulator, the
count was correct. A valid triangle count is required. Otherwise tS crashes.
It is either my code, or a bug in the triangulator. Even Tomas stated, 'I shouldn't
have to do that', referring to ordering the triangle edges in reverse order to 'get
it to work'. Well, that's what I had to do.

froo
Captain
Posts: 2552
Joined: 22 May 2009, 12:13

Re: OBJ Importer/Exporter Plug-in Oddities

Post by froo » 08 Jul 2011, 19:00

Found the header file I modified which includes the GUIDs for the 'texture' connectors:
Alpha, Color, etc. With that, I should be able to compile and debug. Find out what the
hell is wrong with this thing.

Let's see... I think Clinton made some model importers too. Maybe I can ask him how
he did it, in script/plugin.

clintonman
Captain
Posts: 2246
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: OBJ Importer/Exporter Plug-in Oddities

Post by clintonman » 09 Jul 2011, 01:59

froo wrote:...

Let's see... I think Clinton made some model importers too. Maybe I can ask him how
he did it, in script/plugin.
You can ask ;) , but I kept it deliberately simple, ie easy on myself. So none of my importers support concave faces like your obj importer.
Clinton Reese

http://clintons3d.com

froo
Captain
Posts: 2552
Joined: 22 May 2009, 12:13

Re: OBJ Importer/Exporter Plug-in Oddities

Post by froo » 09 Jul 2011, 14:54

ah ok Clinton. :)
Do you have to handle orientation of the application (left vs. right handedness) on import?

froo
Captain
Posts: 2552
Joined: 22 May 2009, 12:13

Re: OBJ Importer/Exporter Plug-in Oddities

Post by froo » 11 Jul 2011, 23:55

Thanks for those pics also Steinie.
Looks like there is a 'mirror effect' going on. The sign of each vertex x-coordinate
is wrong, so it looks like we are looking at the object from the opposite side.
For what that's worth.
I'll check it.

User avatar
Steinie
Captain
Posts: 2736
Joined: 21 May 2009, 17:38
Type the number ten into the box: 10
Contact:

Re: OBJ Importer/Exporter Plug-in Oddities

Post by Steinie » 12 Jul 2011, 02:05

Well I sure hope you can find a solution because it really is one of my most used plugins.
Thanks for putting in the effort for us Froo!

clintonman
Captain
Posts: 2246
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: OBJ Importer/Exporter Plug-in Oddities

Post by clintonman » 12 Jul 2011, 02:17

froo wrote:ah ok Clinton. :)
Do you have to handle orientation of the application (left vs. right handedness) on import?
Yep, pretty much. In a lot of cases I end up taking the negative of the X positions. I think a lot depends on where it's coming from too. Y-up vs Z-up, right vs left handed. In fact I think there may be something weird with trueSpace in the handedness area. I tried to figure it out once but something was backward.
Clinton Reese

http://clintons3d.com

froo
Captain
Posts: 2552
Joined: 22 May 2009, 12:13

Re: OBJ Importer/Exporter Plug-in Oddities

Post by froo » 12 Jul 2011, 02:18

No problem Bob.
I am very sorry that I didn't get to this sooner.

For testing, I did this:
While processing / reading the OBJ file, I multiply the x coordinate by -1.
That seems to work, but now each face of danperk's cube is facing the wrong
way. The good thing is, each letter is facing the right direction.

Sonofabitch. I just did what clinton did. haha!

Post Reply