This topic is 3777 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello Friends, In my project i need to find the shading model for the 3d object mesh. The Mesh can contain a sphere and box (take this as an example), As we know sphere should be renderd with smooth shading(interpolate), and box should be drawn using Flat shading.. But i have only one input mesh ,which does not have this shaing information.. I guess i need to group the mesh depending upon the smoothing angle . Are there any standard method exists or any other nice ideas ? Thanks, KD

##### Share on other sites
This particular bit of shading information, can be stored as proper vertex normals, which should be part of most 3D meshes.

##### Share on other sites
Thanks pismakron.

Do you know whether .3ds have this information ? I am dealing with 3ds format.

##### Share on other sites
To be quite honest I don't know anything about the .3ds format. But I know that with the Lightwave format you had to calculate vertex normals from adjacent surface normals. Which was annoying.

##### Share on other sites
According to this link you'll have to calculate the normals yourself.

Andy

##### Share on other sites
3DS doesn't contain precomputed normals. Instead it contains smoothing groups - and you need to compute the normals on your own. This is not difficult, but you should include some type of spatial sorting to be able to find vertices close to each other quickly. Otherwise you'll end up with O(n^2).

You need to load the SMOOLIST chunk - its hexadecimal ID is 4150.
Firdt you must calculate per-face normals, then it is necessary to smooth all vertex normals close to each other that belong to the same smoothing group.

Alexander

##### Share on other sites
Thank you Porthos,NineYearCycle.

I will see how to do that according to that idea.

1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 9
• 14
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
633331
• Total Posts
3011394
• ### Who's Online (See full list)

There are no registered users currently online

×