Skip to main content
gamedev.net
🔒 Locked

NORMALS

Started by Crash_Kid Apr 20, 2001 at 4:41 AM 4 replies 400+ views
Original Post
Crash_Kid
Crash_Kid
Hi, look this screenshot, isn't it nice ? NO IT ISN'T NICE, because of the light, it looks not very smooth! I have calculate the 'face normals' but i don't know if i have done it in the right way, look at the screenshot and say me if i have done it right. And why, why look all "mountains" the same ? I don't understand this! When i have calculated 'face normals', how can i make 'vertex normals' ? -Thx Edited by - Crash_Kid on April 20, 2001 5:42:32 AM
Thoooms
Thoooms
It's hard to tell wether the normals are correct or not, but it looks ok at the first sight

you use different methops for calculating vertex normals depending on the way you store the data. If you store each triangle linearly you do look at your data

3|-----------------|
|\ |\ |\ |\ |\ |\ |
| \| \| \| \| \| \|
2|-----------------|
|\ |\ |\ |\ |\ |\ |
| \| \| \| \| \| \|
1|-----------------|
|\ |\ |\ |\ |\ |\ |
| \| \| \| \| \| \|
0|-----------------|
0 1 2 3 4 5 6

note that your triangles might be aligned differently, but you see that to calculate the vertex normal for (3,1) you have to add the normals of all the faces that touch the vertex and normalize it. In this case it's triangle nr. 14/15/16/19/20/21. you can derive how to calculate that if you draw it on paper.

Codito, ergo sum - Graphics Programming

Edited by - Thoooms on April 20, 2001 8:15:15 AM
omegasyphon
omegasyphon
looks fine to me just smooth out the terrain
Crash_Kid
Crash_Kid
Without Lighting it looks really nice for something
without ligthing

but with lighting you can extremly see the cornerpoints because
of my face normals And so i have not to smooth out the terrain.
dusik
dusik
To clarify what Thooms said:

A vertex normal vector is the average of the face normal vectors of the faces that share the vertex.

You don''t need to "normalize" the vertex normal given that your face normals should have already been "normalized" (all components in the range of 0.0 to 1.0).

It looks like your face normals are correct, but I can''t be sure from the screenshot. Just keep in mind, when you do the cross product of 2 sides of a triangle to get the normal, that the order matters for cross products. The order (clockwise or counterclockwise) depends on the order you defined the vertices in.

Also, when you calculate the vertex normals, make sure you use Gouraud (or Phong, but probably not recommended) lighting, not Flat shading, to make use of the vertex normals

------------------------
CRAZY_DUSIK* pCrazyDuSiK;
pCrazyDuSiK->EatMicroshaft(MS_MUNCH_BILL_GATES | MS_CHEW_BILL_GATES);
Resist Windows XP''s Invasive Production Activation Technology!
------------------------CRAZY_DUSIK* pCrazyDuSiK = new CRAZY_DUSIK;pCrazyDuSiK->EatMicroshaft(MS_MUNCH_BILL_GATES | MS_CHEW_BILL_GATES);pCrazyDuSiK->WebSiteURL = "http://www.geocities.com/dusik2000";
omegasyphon
omegasyphon
well my next thought was gonna be if u have to blend the lighting into the terrain???

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.