vertex / face normals

I’m trying to write a simple converter between the anim8or format and the egg format. When trying to add normals to the egg file, pview simply seems to be ignoring these. I’ve tried both face normals and vertex normals, no luck at all though…

Is there a special rule for this that I missed?

here is a sample egg file output by the converter for refference:

and its texture:

Hmm. Looks OK to me. You know that you need to toggle lights on in pview with the “l” key, right?


I didnt, but that doesnt matter, vertexes are still inverted. When I hit i to invert them in preview, it looks good, but when I invert them manually, it doesnt seem to matter at all.
Almost seems like panda isnt reading the normals at all…


Just tried messing around with the list order of verteces and polygon’s, seems it matters… Are normals actually used then?

Well, the model is a little strange. You have modeled a cube with the faces oriented towards the interior of the cube. Your normals should, therefore, also point towards the interior of the cube, but you have them pointing outwards.

However, even if you flip the normals around, the model will still look strange, because you will have normals smoothing the lighting at the corners of a cube. Your graphics card will interpret this by computing the color at each vertex as if it were on the inside of a sphere, and then linearly interpolating the color between vertices–which will always look strange on a shape like this (which is nothing like a sphere).

If you want the cube to look like a cube, you should use polygon normals, rather than vertex normals. Panda can generate them for you, if you like:

egg-trans -np -o t.egg test-cube.egg
pview t.egg

If, on the other hand, you want the cube to look like a sphere, you’ll need to put in a lot more vertices.


errrr yeah I see what you mean, my stupid mistake.
Thanks for thinking it out :slight_smile:

Even complex models look good now :slight_smile:

thanks again.