Jump to content
  • Advertisement

Archived

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

Shadow1234567890

Please review algorithm for filling in quads

This topic is 5816 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

I am trying to create a function that can calculate the triangle coordinates that must be used in order to fill in a quad on a plane. I have it already type out and I am using the function but it obviously doesn''t work (Jagged protruding shapes form around my little spaceship and they extend twice the distance of the entire model, its weird). I didn''t want to post the source because it is confusing, I just want to review the steps I took to make sure I have the correct idea. As a side note I already spoke with a math teacher but I cannot go back to him at this time Algorithm: -Read coordinates from file -Divides each coordinate by ScaleSize, store in float[3] array -Finds which vector is longest (this is hypotenuse) -Find midpoint of hypotenuse -Find length from midpoint of hypotenuse to other the coordinate in the triangle, store in scalarvalue -multiply this by 2 -subtract scalarvalue from other vertex to get last coordinate of triangle for example: if AB is the longest, find the midpoint of a to b, find the length from midpoint[ab] to c, find the length of the vector that goes from midpoint[ab] to c. multiply that length by 2 to get vertex c in the mirror triangle. verticies a and b will be the same in both triangles. I hope that made sense, please ask me questions if you have no clue what i am talking about and i will try to explain myself a little bit better. -Thanks if you can help me

Share this post


Link to post
Share on other sites
Advertisement

  • 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!