Results 1 to 8 of 8

Thread: Interpolation of lines in polygon system

  1. #1

    Thread Starter
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755

    Exclamation Interpolation of lines in polygon system

    Hi!

    Im making a polygon system and i want the user to be able to click one polygon to interpolate it.

    I've made an illustration that shows how this should be done.


    If you dont understand what i mean, just ask!
    Attached Images Attached Images  
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  2. #2
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Basic algebra =P.

    Figure out the components of a ray that starts at the red dot next to the points selected, using that point, and the point before it (find the purple lines). Find the half angles. Create a set of parametric equations for each line (google it, if you dont know what I am talking about). Substitute one equation into the other, and solve for t. Use the final t value to find the intersection point.

    If you ever need to find intersection points with anything, chances are that you will use substitution. Learn it well =).

    Z.

  3. #3

    Thread Starter
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    ok!
    thanks!
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  4. #4

    Thread Starter
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    do you think you could show me some code how to do it?
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  5. #5
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Knew you would ask =P.

    No, It sounds like a pain in the arse, and it wouldnt help you much if I just did it for you =).

    Z.

  6. #6

    Thread Starter
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    ok...
    but i just dont know how to do the substitution...

    could you just give me an example?
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  7. #7
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Google it =).

    Z.

    [edit]
    Or go ask in the math forum =).

  8. #8

    Thread Starter
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    ok!
    thanks anyways...
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width