31st January 2005, 01:19 AM | #1 |
Junior Member
Junior member
Join Date: Apr 2004
Posts: 7
|
To smooth or not to smooth
I used the AC3D file format documentation and the sample loader to integrate the .ac format directly into my application. It was very straight forward. My compliments to the chef!
I have a couple basic questions. I'll start with this one for now: Is there information or a flag stored somewhere in the format that I can use to let my renderer know when a surface normal should be used instead of vertex normals when rendering a surface. The difference being a flat shaded or smooth shaded result, respectively. Reworded for clarity: Some models require flat parts and smooth parts. How can I tell if a specific surface should be flat or smooth shaded in an AC3D object? Thank you in advance. robo |
31st January 2005, 06:39 AM | #2 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,565
|
The flag on SURF indicate is a surface should be flat or smooth shaded:
Code:
SURF %d The start of a surface. The parameter specifies the surface type and flags. The first 4 bits (flags & 0xF) is the type (0 = polygon, 1 = closedline, 2 = line). The next four bits (flags >> 4) specify the shading and backface. bit1 = shaded surface bit2 = twosided. Andy |
31st January 2005, 10:01 AM | #3 |
Junior Member
Junior member
Join Date: Apr 2004
Posts: 7
|
That is exactly what I was looking for. I read about the flags but since the words flat and smooth were not actually listed in that paragraph I thought the flag was for shaded or not shaded at all.
Thank you for the fast response (and the great 3D tool)! |
|
|