vn 0.000000 -1.570796 0.000000
vn 0.000000 -1.570796 0.000000
vn 0.000000 -1.570796 0.000000
vn 0.000000 -1.570796 0.000000
vn 0.000000 1.570796 0.000000
vn 0.000000 1.570796 0.000000
vn 0.000000 1.570796 0.000000
vn 0.000000 1.570796 0.000000
# 8 vertex normals
problem with exporting normals with .obj in 3ds
I've loaded some .obj models into my .obj loader and I got a nasty suprise because the normals in the file weren't the same as the normals in max.
Here is a screenshot of the lighting in my engine:
The staires they should be lit uniformly all across.
The bottom half of the arches at the back should be lit the same way as the top half.
the tops of the pillars should be uniformly lit.
The normals as shown in 3ds are set to do all these things, however once it's exported into a .obj, all the normals are smoothed into a single smooth group.
Take a cube for instance:
when I export it I should get 6 normals, one for each axis direction.
+x -x +y -y +z -z
But I get 8.
Here is a sample from the .obj file:
Note that there are no normals in the x or z direction, also, they arn't even normalized!
Here are the settings I used to export this cube.
I've fiddled around with different settings but they all do the same thing...I've even gotten a really good moddeler to export his models and we are getting the same problem.
Is there something we have to do to max to make it export properly.
Is this a bug?
Or is it supposed to do this for some reason?
thanks for reading.
Well, I don't normally look at obj files in text format so I don't know if I can help you there. However, I am aware of the issue that you're running into and know why it's occuring. The obj format is an alias format that is native to programs such as Power Animator and Maya.
In Maya smoothing groups for normals are done on an edge level to allow more control. In Max they are done on a face or poly level, which is slightly more restrictive. Therefore, the way an OBJ file stores normal information for smoothing groups is going to be different than how Max does it by default. The only thing that might help is exporting the faces as "Polygons" rather than "Triangles" in the export options, but I'm not 100% positive this will actually help. Maybe when I get some time I'll see if I can find a way around this.
In Maya smoothing groups for normals are done on an edge level to allow more control. In Max they are done on a face or poly level, which is slightly more restrictive. Therefore, the way an OBJ file stores normal information for smoothing groups is going to be different than how Max does it by default. The only thing that might help is exporting the faces as "Polygons" rather than "Triangles" in the export options, but I'm not 100% positive this will actually help. Maybe when I get some time I'll see if I can find a way around this.
hm, I'm sorry I dont know the answer- but its not surprising you have 8 normals, since it says there vertex normals and theres 8 verts in a cube.
I have heard of objs screwing normals, I just tried exporting and importing a cube in max, and yeah the export seems to smooth everything :(
edit ok try this:
on your export settings;
all to default
check use materials (I dont know if this affects it, its on in my export)
unchecked create material lib
check rotate model
faces: polygons
check texture coordinates
UN check normals
checked smooth groups
vert scale 1
I have #of digits to max (12) for accuracy
last 2 unchecked
using these settings, I set up my smooth groups, exported a box, imported it
(again with normals unchecked) and obj smooth groups checked and the smoothing was preserved.. if these settings dont work in your engine, it might be you need to look at supporting Obj smooth groups. This is just a guess from trial end error though, I'm not an authority on it :)
[Edited by - red_produkt on July 24, 2006 4:02:58 PM]
I have heard of objs screwing normals, I just tried exporting and importing a cube in max, and yeah the export seems to smooth everything :(
edit ok try this:
on your export settings;
all to default
check use materials (I dont know if this affects it, its on in my export)
unchecked create material lib
check rotate model
faces: polygons
check texture coordinates
UN check normals
checked smooth groups
vert scale 1
I have #of digits to max (12) for accuracy
last 2 unchecked
using these settings, I set up my smooth groups, exported a box, imported it
(again with normals unchecked) and obj smooth groups checked and the smoothing was preserved.. if these settings dont work in your engine, it might be you need to look at supporting Obj smooth groups. This is just a guess from trial end error though, I'm not an authority on it :)
[Edited by - red_produkt on July 24, 2006 4:02:58 PM]
WorldPlanter was on to the right track, it's a compatibility issue between max and maya, one of many preventing fluid interchangability. The workaround is pretty simple though, you have two options I know of... either don't export normals/shading groups when exporting to .obj, or don't import the information when importing the model into your engine/other application.
Simple test I did with max, also tested it in maya. You *could* export from max, import into maya, export from maya and it will fix the problem as well - but that just seems like too many steps and programs that aren't needed to be used, just uncheck exporting normals/shader groups and you're good to go.
Hope this was helpful.
Simple test I did with max, also tested it in maya. You *could* export from max, import into maya, export from maya and it will fix the problem as well - but that just seems like too many steps and programs that aren't needed to be used, just uncheck exporting normals/shader groups and you're good to go.
Hope this was helpful.
does that solution not mean putting up with everything hard edges though? I still think its worth looking at obj smooth groups, since I successfully exported/imported correct smooth and hard shading
Maybe you should avoid loading the normals from obj. alltogether and generate them as a preprocess in you loader. As far as I can see, you won't be needing to adjust the normals in the scene from the screenshot.
If you really want to keep loading them, I don't think the problem is between Max and Maya. I think the indices of the normals aren't the same as the indices of the vertices. Try not exporting the smoothgroup information in the exporter menu and you should be fine. It worked for me then.
Good luck,
Jeroen
If you really want to keep loading them, I don't think the problem is between Max and Maya. I think the indices of the normals aren't the same as the indices of the vertices. Try not exporting the smoothgroup information in the exporter menu and you should be fine. It worked for me then.
Good luck,
Jeroen
I tried experimenting with different OBJ export options last night and compared the results between Max and Maya. As long as all your normals are unified for the object you're exporting you should only have to uncheck the Normals option in the dialog box. Leave the Texture coordinates and Smooth groups checked though and you should be fine. This will allow the object to retain its soft and hard edges as you have them in Max. The normal information isn't necessarily critical for your object unless you were manually editing the rotation of normals with the Edit Normal modifier in Max.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement