PDA

View Full Version : Smooth model surfaces


imikedaman
2006.07.12, 08:50 PM
Hi, I'm having an annoying and all-too-common problem with my 3D models, both within the editor and rendered in-game. Here's a look at the worst section of it:

http://waterfallsw.com/~mike/model.png

The surface of the model is very smooth and rounded off, but I'm getting all sorts of nasty artifacts like those on the polygons. Why isn't it nicely interpolated? I assumed for a while it was a problem with my code, but that's a screenshot from within Cheetah3D.

EDIT: Wow, that picture suggests that it isn't interpolating the values *at all*. Right now my best guess is that my code is fine, but Cheetah3D is mucking up the data file. All I know is the in-game model looks exactly like the model in the editor, artifacts and all.

OneSadCookie
2006.07.12, 10:33 PM
Technically, you need per-vertex normals, not per-face normals.

I'm not sure how Cheetah3D works, but in Wings you'd select all the edges and make them soft as opposed to hard, and in at least one other program you'd make sure that everything was in the same "smoothing group".

AnotherJake
2006.07.12, 10:48 PM
Yeah, I don't know how Cheetah3D works either but that definitely looks and sounds like a problem with your normals. Echoing OSC, it looks like your normals are set per face as opposed to per vertex. If there is a way to view the normal vectors in the program you'll probably see more than one line pointing away from each vertex. The normals at each vertex should look like just one line, indicating that they are pointing in the same direction at any given vertex. I don't know if that makes any sense, but if you can turn on viewing normals in your editor you'll probably pick up on it right away.

imikedaman
2006.07.13, 02:34 AM
Huh, in that case it's probably also due to a bug in my code, since I do use vertex normals. Since the 3DS file format I use doesn't contain any normals, I generate the face normals, then for each vertex I take the normalized average of all the adjacent face normals. Odds are the code is messed up somewhere since it clearly isn't doing that right.

Thanks guys, hopefully I'll figure that one out.