Calculating Vertex Normals...

Started by
11 comments, last by RobTheBloke 18 years, 5 months ago
My brother is a model designer since years. And he uses quads each time it is appropriate. Modelling apps seldom guarantee that quads are flat, but the designer may take care. There are many situations out there in which quads (and even higher corner count polygons) may make the life of the designer easier. And IMHO, it is the job of the programmer to fulfil the wishes of the artists.

Quote:Original post by paic
For my method, I don't say it's the perfect method. I actually think Haegarr's method is better. But I did use my method for quite a time, and I didn't test Haegarr's one. And I usually only speak about what I know ^^ So, my advice would be : try Haegarr's method first. And if you have problems, you can try my dirty trick ^^

The method of weighting the normals by the angles of the participating faces isn't my own one. dhk has recently made a thread about terrain generation, and I've suggested the weighting method. It has been implemented and decided to work well (however, his terrain has not such sharp angles as a cube has).
Advertisement
@Rob : That's quite rude to say "rubish" at someone else's statement without giving any argument... Did you try to create a cube, triangulate it, switch to vertex edit mode, "set vertex normal" with "unlock normals" on. That's the procedure to recompute smooth normals on a mesh. Try that on a TRIANGULATED cube, and tell me if it gives good normals. At least on Maya 6.0, normals are NOT correct. And even when you "set to face" and "soften / harden" with 180° after that, the results are the same. So please, don't say something is rubbish without proving it. And don't say my graphists are at fault when you don't know them, and obviously never did the test with Maya.

As for modelling, well, you say modeller shouldn't model with quads ? Then 99% of the modellers I know (and I know a lot, I can assure you) have to go back to school. Ho, and techers also need to stop telling them to use quads ... Maybe I didn't understand what you said about quads, so, sorry if I didn't understand.

And for your last statement, I'm triangulating because DirectX wants triangles -_- And as graphists usually model with quads, I need to convert those quads into triangles. And MItMeshPolygon gives you POLYGONS, not triangles. I know the Maya C++ API quite well but if you can give me the way of getting triangle list (and NOT POLYGON) without having to do anything, I would really be happy !

Ok, sorry for the post off-topic, but I really don't like when people say "rubbish" or "your graphists suck" or stuff like that, without giving any argument.

[Edited by - paic on November 16, 2005 3:41:45 AM]
Quote:@Rob : That's quite rude to say "rubish" at someone else's statement without giving any argument... Did you try to create a cube, triangulate it, switch to vertex edit mode, "set vertex normal" with "unlock normals" on. That's the procedure to recompute smooth normals on a mesh. Try that on a TRIANGULATED cube, and tell me if it gives good normals. At least on Maya 6.0, normals are NOT correct. And even when you "set to face" and "soften / harden" with 180° after that, the results are the same. So please, don't say something is rubbish without proving it. And don't say my graphists are at fault when you don't know them, and obviously never did the test with Maya.


you are correct, logged as bug 241378. My bad.

Quote:Original post by paicAs for modelling, well, you say modeller shouldn't model with quads ? Then 99% of the modellers I know (and I know a lot, I can assure you) have to go back to school. Ho, and techers also need to stop telling them to use quads ... Maybe I didn't understand what you said about quads, so, sorry if I didn't understand.


Well, i taught maya for almost 4 years, over which time i taught maya to over 600 modellers, animators and programmers (so i know a few too). my lectures certainly covered the problems of non-planar quads. You can guarentee that a triangle is always planar, you can't with any other poly type. Create a quad, pull a single vertex up a bit. How will maya triangulate that? Often it's not in the way that you imagine, and so the results can look very bad. Modellers need to consider the exact triangulation on problem areas of deformation such as knees, elbows, or any other sharp contours of a model. When deforming a surface, any quads that may have been planar in a static pose, will probably be non planar when animated. It is usually at that point that the default maya triangulation (Maya has to triangulate to render the data afterall) can cause *very* ugly skinning artifacts.

It's not that modelling in quads is *bad*, but if you do, you really need to concern yourself with any quads that may be distorted later (anything skinned or blend shaped) and ideally fix those manually before going any further. Often quads are a nice primitive for modellers to work with, since there are less edges getting in the way when you split and merge faces, however leaving the model as quads is not often recommended.

Quote:And for your last statement, I'm triangulating because DirectX wants triangles -_- And as graphists usually model with quads, I need to convert those quads into triangles. And MItMeshPolygon gives you POLYGONS, not triangles. I know the Maya C++ API quite well but if you can give me the way of getting triangle list (and NOT POLYGON) without having to do anything, I would really be happy !


check the maya docs on the following two functions :

MItMeshPolygon::numTriangles();
MItMeshPolygon::getTriangles();

you need to build up a reference between the vertex indices returned from getTriangles so you can determine which normals and UV's to use, but it does work (you can ignore the returned points, and providing any MSpace is going to be valid, since it's the indices you want and no more).

This topic is closed to new replies.

Advertisement