3ds smoothing groups + vertexcolor

Started by
8 comments, last by godmodder 16 years, 10 months ago
how would one retrieve smoothing groups information from a 3ds file? how does smoothing groups work? are all the vertex normals in a smoothing group the average of the neighbor face normals.. and where 2 different smoothing groups meet the average vertex normals are separated...? [Edited by - Dragon_Strike on May 27, 2007 9:16:54 AM]
Advertisement
mesh->faces[y].getSmGroup();

Yes, that's exactly how they work. Vertices on an edge that straddles faces with different groups don't average together.
------------------------------Great Little War Game
Quote:Original post by RubiconMobile
mesh->faces[y].getSmGroup();


thx for the answer.. but i dont know where u got that function... what id like to know is the hex code for the smoothing groups and some hints on how to load the data...
didnt want to create another post.. as well as my smoothing groups question.. i wonder if its possible to load vertex colors with 3ds?
after alot of guessing i think ive finally figured it out.. does this look correct?

#define SMOOTHING_GROUP_LIST 0x4150case SMOOTHING_GROUP_LIST:							F_SMOOTHING_GROUP_LIST();break;void Model_3DS::F_SMOOTHING_GROUP_LIST(){		int amount = m_Object_3DS.back().faces_amount;	m_Object_3DS.back().FaceSmooth = new long int[amount];	for (int i = 0; i < amount; i++)	{		fread (&m_Object_3DS.back().FaceSmooth, sizeof (long int), 1, file);		}}


but im a bit unsure of what to do next... doin something like thsi seems a bit much... also it only works for edge cases taht are caused tu to texturing and alike...

for each face
for each face
if smoothgroups is equal
for each vertex
if vertex pos is equal
avarage normals
I can't help you much, and it doesn't look like anyone else really can.

Are you free to choose your 3D mesh format? If so, there are far better choices than 3DS. If not, then there must be some available 3DS loaders for your 3D API. Tell us what you're developing in.

Admiral
Ring3 Circus - Diary of a programmer, journal of a hacker.
Quote:Original post by TheAdmiral
I can't help you much, and it doesn't look like anyone else really can.

Are you free to choose your 3D mesh format? If so, there are far better choices than 3DS. If not, then there must be some available 3DS loaders for your 3D API. Tell us what you're developing in.

Admiral


yes i am free to choose my format...

what formats do u recommend?

there is lib3ds but i havent managed to get it working...

what i need is a proper model loader that has most function and variables but doesnt need any animation functions...
If you're using 3DSMax you could always write your own custom exporter for max that saves out the data you need.

I agree with theadmiral on the 3ds format. I wrote a parser a few years ago and it was such a pain. Just not a great format for games.
that sounds interesting.. but how would i write my own exporter/importer? do u have any more info on that?
Hello,

you've got three options: 1) write an exporter in MaxScript (can't help you with this ;<) )
2) write an exporter with the MAXSDK
3) write an exporter with the IGame interface

The last option is the way I did it and the easiest IMHO if you're already proficient with C++. It's a high-level interface to use the MAXSDK, aimed squarely at you: the game-programmer. Some may say it's a bit clumsy to use and yes it has it's share of bugs when you do really advanced things, but in the end it's just a matter of taste and it sure is a lot easier to pick up than the MAXSDK!
I've heard MaxScript now supports writing binary files too, so you might as well check it out if you're prepared to learn a new language...

Hope I've been able to help,
Jeroen

This topic is closed to new replies.

Advertisement