Determining the vertex normals of a line strip

Started by
7 comments, last by cmcginnis 21 years ago
What is a good way to determine the vertex normals for a line strip? Should it just be the direction vector in which each segement of the line strip is heading?
Advertisement
why do u need lighting for a line strip ?

if u really do then the vertex normal is the average of the line normals that share the vertex

if v is the vertex, vl is the last one and vn is the next
vNormal = Normalize( Normalize(CrossProd(v - v1), Normalize(CrossProd(vn - v));

(maybe u have to make vNormal = -vNormal if is points in the wrong way )

shouldnt it just be:

vNormal = Normalize( CrossProduct( v-vl, vn-v) );

i just didnt quite understand ur notation for the cross product anyway, the question stands: y would u want normals for a line strip?
- To learn, we share... Give some to take some -
You guys do realize that there are an infinite number of normals for a vertex on a line segment, right?

i.e. a line is a 1-dimensional entity, therefore a normal for that line is ANY vector which is perpendicular to it.

I third the question: why do you need normals for a line strip?

Regards,
Jeff
The main reason for asking is so lighting calculcations can be performed in DirectX. The line does get lit when I add ambient light, but I thought it would be better if it included normal information.
rypyr is kinda right

but we could look at the lines like in 2D so there would''n be an infinte num of normals

and again why would u nicely light a line strip ?? i dont get it
there isnt much difference between a light and an unlight line is it?

In Direct3D a line does not get lit with a material''s color unless it has a vertex normal or the ambient color is set.
quote:Original post by Ilici
but we could look at the lines like in 2D so there would''n be an infinte num of normals


If you did this, then all the normals would point out of the screen, and all would be lit the same. Does this make sense to do?

Regards,
Jeff
Couldn''t you just turn lighting off, draw the line using whatever color you want it and then turn lighting back on? I''m not sure if this is what you''re looking for though.

This topic is closed to new replies.

Advertisement