Jump to content
  • Advertisement
Sign in to follow this  
cpcollis

Split Vertex, calculating the new Normal vector

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have some code that splits a vertex on a plane and creates a new point where the vertex intersects the plane. So I have start and end verticies which lie on either side of the plane. What I need to know is to calculate the normal for the new vector, assuming that the start and end verticies have different normals. Thanks, Chris

Share this post


Link to post
Share on other sites
Advertisement
I've thought of something like this:

Vector3 normal = ((start.Normal*proportion) + ((1-proportion) * end.Normal));

where proportion is:
float proportion = Vector3.Length(start.Position - middle) / Vector3.Length(start.Position - end.Position);

and middle is the point of interseciton with the plane.

But I'm not convinced this works :/

Edit: it doesn't work

[Edited by - cpcollis on August 25, 2004 7:16:35 PM]

Share this post


Link to post
Share on other sites
Solution:

normal.X = start.Normal.X + (end.Normal.X - start.Normal.X) * proportion;
normal.Y = start.Normal.Y + (end.Normal.Y - start.Normal.Y) * proportion;
normal.Z = start.Normal.Z + (end.Normal.Z - start.Normal.Z) * proportion;

Edit: lol, or this:

Vector3 normal = start.Normal + (end.Normal - start.Normal) * proportion;

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!