9th October 2004, 06:37 PM | #1 |
Member
Expert member
Join Date: Mar 2004
Location: Germany
Posts: 75
|
Surface normals
Hi,
when I make a sphere. The normal vertices are rigid per surface. But the normal vertices of a surface in reality are not. They area the sum of all sufrace's normal vertices that are attached to that point. Is there any way to tell the program to use smoothed normals instead of rigid one per surface-part? I hope my problem is understandable?
__________________
www.GLBasic.com |
16th November 2004, 10:00 AM | #2 |
Member
Expert member
Join Date: Mar 2004
Location: Germany
Posts: 75
|
er...
has noone ever recognized this, or are you using subdivisions to the max? Or is there a switch I've not seen, yet? I'm modelling low-poly models for a game and surface normals are very important for me. Otherwise low poly models look ugly...
__________________
www.GLBasic.com |
16th November 2004, 05:43 PM | #3 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,565
|
The vertex normals of a sphere are the average of all attached surfaces.
Isn't this what you want? Note that pressing 'n' to display normals, displays SURFACE normal and not vertex normals. AC3D calculates normals automatically using geoemtry and the object's crease angle for smoothing. Any surfaces that are set to 'flat' will have their vertex normals the same as the surface. Hope this helps, Andy |
16th November 2004, 08:37 PM | #4 |
Senior Member
Professional user
Join Date: Nov 2003
Location: Eugene OR, USA
Posts: 212
|
just incase you didnt know...
to set your surfaces to flat or smooth, there are a couple of buttons at the bottom left corner of ac3d, that say 'flat'/'smooth'. you probly already knew that, but im not completly undestanding your question. --Phil |
17th November 2004, 03:57 AM | #5 |
Member
Expert member
Join Date: Mar 2004
Location: Germany
Posts: 75
|
Ah. Thank you. I didn't know that. I think it is what I've been searching for. However it's not working still. I seperated all into triangles, and I think each triangle is a unique surface now. How can i "merge" the triangles of an object, so AC3D knows that these surfaces belong to one and should be smoothed?
BTW: Here's the code for exporting, maybe it's wrong? Code:
// Triangles of surface static void ddd_output_triangle(POLY_FRAME *pframe, List *vertices, Surface *s) { SVertex *p1; POLY_NODE node, node_new_tri; node_new_tri.col = COL_NEW_TRI; pframe->nodes.Push(node_new_tri); node.col = ddd_get_material_color_rgb(s->col); for (long n=0; n<3; n++) { switch(n) { case 1: p1 = (SVertex*)(s->vertlist->data); break; case 0: p1 = (SVertex*)(s->vertlist->next->data); break; case 2: p1 = (SVertex*)(s->vertlist->next->next->data); break; } node.normal[0] = p1->normal.x; node.normal[1] = p1->normal.y; node.normal[2] = p1->normal.z; node.pos[0] = p1->v->x; node.pos[1] = p1->v->y; node.pos[2] = p1->v->z; node.tex[0] = p1->tx; node.tex[1] = - p1->ty; pframe->nodes.Push(node); } } |
17th November 2004, 01:09 PM | #6 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,565
|
That looks correct.
For the vertex normals to be smoothed across surfaces, the vertices must be shared by all of those surfaces. If you are joining non-joined surfaces, this is usually done by moving vertices to the same position (Vertex->snap-togther) then Object->optimize-vertices. This will remove any duplicates that are at the same position. before this is done, all surfaces being joined must reside in the same object. If this isn't the solution, can you illustate the problem more - either with images or some import code? Andy |
19th November 2004, 04:30 AM | #7 |
Member
Expert member
Join Date: Mar 2004
Location: Germany
Posts: 75
|
Yes. Snap vertices together - that was it. I could see it immediately in the preview window. I need accurate surface normals for cel shading outlines. See a picture:
Thanks a lot. AC3D is the very best 3D low poly modeller. Even a non-artist like me can make 3D models with it.
__________________
www.GLBasic.com |
|
|