Page 2 of 4

Re: OBJ Importer/Exporter Plug-in Oddities

Posted: 05 Jul 2011, 18:07
by froo
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:

Re: OBJ Importer/Exporter Plug-in Oddities

Posted: 05 Jul 2011, 18:59
by pugman 1
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

Re: OBJ Importer/Exporter Plug-in Oddities

Posted: 05 Jul 2011, 23:56
by froo
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.

Re: OBJ Importer/Exporter Plug-in Oddities

Posted: 08 Jul 2011, 19:00
by froo
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.

Re: OBJ Importer/Exporter Plug-in Oddities

Posted: 09 Jul 2011, 01:59
by clintonman
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.

Re: OBJ Importer/Exporter Plug-in Oddities

Posted: 09 Jul 2011, 14:54
by froo
ah ok Clinton. :)
Do you have to handle orientation of the application (left vs. right handedness) on import?

Re: OBJ Importer/Exporter Plug-in Oddities

Posted: 11 Jul 2011, 23:55
by froo
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.

Re: OBJ Importer/Exporter Plug-in Oddities

Posted: 12 Jul 2011, 02:05
by Steinie
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!

Re: OBJ Importer/Exporter Plug-in Oddities

Posted: 12 Jul 2011, 02:17
by clintonman
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.

Re: OBJ Importer/Exporter Plug-in Oddities

Posted: 12 Jul 2011, 02:18
by froo
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!