Thread: Please review algorithm for filling in quads

  1. #1
    Shadow12345
    Guest

    Please review algorithm for filling in quads

    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

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793

  3. #3
    Shadow12345
    Guest
    But i wanted people in both forums to see this

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Originally posted by Shadow12345
    But i wanted people in both forums to see this
    Yeah, but not everyone visiting both forums wants to see the same post twice.....its annoying to answer a post and then find exactly the same conversation going on in another forum. That's why the rule is there.

  5. #5
    Shadow12345
    Guest
    ok ok sheesh sorry!

    Now lets start a conversation that relates to my problem, if you don't mind.
    Did what I say (in first post) make any sense to you? Do you think I should logically change any of the steps?

  6. #6
    Shadow12345
    Guest
    Okay I guess everyone hates me.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  2. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  3. Please review algorithm for filling in quads
    By Shadow12345 in forum Game Programming
    Replies: 1
    Last Post: 10-17-2002, 07:45 AM