Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Simple math problem.

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2011
    Posts
    19

    Simple math problem.

    Hello, I am having some issues, for some reason my brain won't connect.

    I have a tile as shown on this image


    I want to divide this tile into 4 new tiles.
    The tile is composed with sides the length of 1 unit, but the height of each corner is variable.

    So when I create the new tiles, I am unable to figure out the height that the new corners should have.

    Basically I can't find a way to determine the y values of p5, p6 and p7.

    as shown here.


    Any help would be appreciated.

  2. #2
    Member Regular Contributor trinitrotoluene's Avatar
    Join Date
    Sep 2008
    Location
    Montérégie,Québec
    Posts
    354

    Re: Simple math problem.

    To find the coordinates of your points p5, p6 and p7, you can use the definitions and properties defined for points and vectors
    So to calculate p5, you can do this:
    Code :
    p5 = p1 + (p2-p1)*0,5 // here p1 is the "origin"
    or p5 = p2 + (p1-p2)*0,5 //here p2 is the "origin"

    p2-p1 and p1-p2 define a vector. p5 is half way to p1 and p2 so the vector is multiplied by 0,5. The addition of a point with a vector give another point. Derive the other points with the same method.

  3. #3
    Junior Member Newbie
    Join Date
    Dec 2011
    Posts
    19

    Re: Simple math problem.

    Thanks for replying,
    Yeah after the champagne I realized that basic vector math's would easily give me the answer, I got no idea why I forgot about it.

Posting Permissions

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