Go Back   AC3D Forums > Technical > AC3D Developers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 31st January 2005, 01:19 AM   #1
robosport
Junior Member
Junior member
 
Join Date: Apr 2004
Posts: 7
Default 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
robosport is offline   Reply With Quote
Old 31st January 2005, 06:39 AM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default

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.
For rendering in AC3D, it calculates the vertex normals by averaging the attached surface normals (using the crease angle too). Any surfaces that are set to be 'smooth' will be drawn using the vertex normals; vertices of a 'flat' surface will get the surface normal.

Andy
Andy is offline   Reply With Quote
Old 31st January 2005, 10:01 AM   #3
robosport
Junior Member
Junior member
 
Join Date: Apr 2004
Posts: 7
Default

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)!
robosport is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 04:19 PM.


AC3D Forum
(C) Inivis Limited 2020