#### Archived

This topic is now archived and is closed to further replies.

# Determining the vertex normals of a line strip

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

## Recommended Posts

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?

##### Share on other sites
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 )

##### Share on other sites
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?

##### Share on other sites
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

##### Share on other sites
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.

##### Share on other sites
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?

##### Share on other sites
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.

##### Share on other sites
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

##### Share on other sites
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.

1. 1
2. 2
3. 3
Rutin
15
4. 4
khawk
14
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633661
• Total Posts
3013226
×