Jump to content
  • Advertisement

Archived

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

Joe Forhens

Extruding a triangle .

This topic is 5729 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 a triangle (3 Vertices) and i would like to write a function that will return 3 other points wich will be the projections of those vertices based on a vector . Any ideas - links ?

Share this post


Link to post
Share on other sites
Advertisement
Afternoon, Joe Forhens.

Ysaneya meant exactly that.

Add the extruding vector to each vertice in your face.

  
VecFace.x += VecExtrude;
VecFace.y += VecExtrude;
VecFace.z += VecExtrude;


Cheers,
Scronty

Share this post


Link to post
Share on other sites
Thx , do you mean :
Vertex.X += VecExtrude.X;
Vertex.Y += VecExtrude.Y;
Vertex.Z += VecExtrude.Z; ?
And if this is the case , if i extrude the point using a vector 0,10,0 will i get vertices that are just 10 units higher than the ones i originally had ?

Share this post


Link to post
Share on other sites
Afternoon, Joe Forhens.

Yes. My fubar, sorry.

  
Vertex[0].X += VecExtrude.X;
Vertex[0].Y += VecExtrude.Y;
Vertex[0].Z += VecExtrude.Z;

Vertex[1].X += VecExtrude.X;
Vertex[1].Y += VecExtrude.Y;
Vertex[1].Z += VecExtrude.Z;

Vertex[2].X += VecExtrude.X;
Vertex[2].Y += VecExtrude.Y;
Vertex[2].Z += VecExtrude.Z;

Is correct.

So if VecExtrude is (7.07, 7.07, 0), then you''d move your face 10 units up/left.

Cheers,
Scronty

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!