PDA

View Full Version : facenorals =ok but vertex normals=parallel bands



03-02-2004, 08:22 AM
hi folks,
iam new to openGL started my juorney with a cad program. i wrote a 3ds loader for my CAD program.very thing is fine till yester day. it loads the model and loads the textures too if they r in the same directory and specifies face normals.but model some what faceted,even though the texture is wrapped very nicely. but when i used vertex normals by averaging all the shared faces for that vertex .now the model is much smooth compared to the old one but there are black parallel bands all over the model (some times black circles) which r predominating at large distances and not much significant at smallre distances. plz i want solution for this problem . i have to submit this project not so far from now. any help is highly appreciated.

Nychold
03-02-2004, 01:05 PM
Are you normalizing your normal vectors? Normalizing means making the total length of the vector equal to 1, and is best calculated by dividing each vector component by the length of the current vector.



let v,w be vectors in 3D space such that:
v=(x1,y1,z1) and w=(x2,y2,z2)

Then, the dot product between the two vectors is:

v*w = x1*x2 + y1*y2 + z1*z2

The magnitude or length of a vector is defined as the square root of the dot product between a vector v and itself:

| |v| | = sqrt(v*v) where v is a vector in 2D or 3D space.

03-03-2004, 11:43 AM
iam already Using GL_NORMALIZE . so there is no need of any more normalising stuff . but still iam normalising my normals butr it is of no help. http://www.opengl.org/discussion_boards/ubb/frown.gif
-indra