Notifications
Clear all

[Closed] 3ds max sdk export MNMesh's normals

Hello,

As i said in the title I’d like to get normals from a MNMesh Object…

i’d like to get them to export them like in an OBJ file, I mean not 1 normal by face but one by vertex

Could you help me please

8 Replies

what have you tried so far ?

i use the igame wrapper for my exporter and it works fine on any object/primitive/mesh with various/numerous modifiers in the stack the final export is wysiwyg including any edit normal modifiers and or collapsed normals which are specified explicit.

Or do you need to write the normals from the modifier ? and not from a specific exporter.

Hope this helps you on your way…


	for(int f = 0; f < mesh->numFaces; ++f)
	{
		Point3 normal;
		Face* face = &mesh->faces[f];

		for(int v = 0; v < 3; ++v)
		{
			DWORD vi = face->v[v];
			Point3 normal;
			if(mesh->getRVertPtr(vi))
				normal = GetVertexNormal(mesh, f, mesh->getRVertPtr(vi));
			else
				normal = Point3(0, 0, 1);	
			mprintf("			<normal x=\"%f\" y=\"%f\" z=\"%f\" />
", normal.x, normal.y, normal.z);
		}
	}

Thanks for help

I think i’ll use the igame wrapper because the “GetVertexNormal” function doesn’t give me the informations i want to get but it seem iGameMesh object has it

a quick note, if you are looking to get access to the tangent/binormals they are not stored on the same “face” topology as the normals, you have to use the following…

int tbIndex = mesh->GetFaceVertexTangentBinormal(i, j); 
  mesh->GetTangent(tbIndex)
  mesh->GetBinormal(tbIndex)

for tangents and binormals
as opposed to…

mesh->GetNormal(f->norm[j],true)

for normals

where i = faceindex & j = face_vert_index

it’s also worth noting that the binormals and tangents are returned in world space where as normals you can specify world or local. So you may need to multiply them by the inverse transform.

I tried to use the igamemesh object witch has normals data but i don’t find information about how do I create this object using an INode object could you tell me where i can find info about it

best place to start is the igame exporter example in the SDK.

I’m stupid I had to think the SDK as samples ^^
thank you

I tried the igame project inside the sdk and it was exactly what i was looking for so thank you