A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: [F8] [HELP] point location problem!!

  1. #1
    talk to the hand! Never_land:('s Avatar
    Join Date
    Nov 2007
    Location
    your mother's bedroom
    Posts
    490

    [F8] [HELP] point location problem!!

    hi fk people, I know this is the game section but I love you guys .


    I need to find the x,y of the red point
    It's related to the main object, and it must be in the line between x_1 and x_2
    any help
    thnx in advance

  2. #2
    Knows where you live
    Join Date
    Oct 2004
    Posts
    944
    So you are trying to find the closest point on a line to another point?

    That can be done using either trig or coordinate geometry and a hint of algebra.
    http://www.google.ca/search?q=findin...ient=firefox-a

    The general idea is find the equation of a line perpendicular to x_1, x_2 passing through the point and find the intercept of the original and perpendicular line.
    The greatest pleasure in life is doing what people say you cannot do.
    - Walter Bagehot
    The height of cleverness is to be able to conceal it.
    - Francois de La Rochefoucauld

  3. #3
    talk to the hand! Never_land:('s Avatar
    Join Date
    Nov 2007
    Location
    your mother's bedroom
    Posts
    490
    can you give me an as2 example I don't get that other lenguage

    Edit:what is float?
    Last edited by Never_land:(; 02-15-2008 at 11:59 PM.

  4. #4
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    you should make it more clear,- the current pic is not at all!
    for instance wich red dot,- there are several
    - are the orgins of the circle things 90° tangent to the line of x_1 to x_2?

  5. #5
    Knows where you live
    Join Date
    Oct 2004
    Posts
    944
    I have this really old experiment (no source, unfortunately). Is it what you are going for?
    http://www.sharemation.com/691175002...20circle2.swf?
    Last edited by 691175002; 02-16-2008 at 03:21 AM.
    The greatest pleasure in life is doing what people say you cannot do.
    - Walter Bagehot
    The height of cleverness is to be able to conceal it.
    - Francois de La Rochefoucauld

  6. #6
    talk to the hand! Never_land:('s Avatar
    Join Date
    Nov 2007
    Location
    your mother's bedroom
    Posts
    490
    Quote Originally Posted by 691175002
    I have this really old experiment (no source, unfortunately). Is it what you are going for?
    http://www.sharemation.com/691175002...20circle2.swf?
    that's exactly what I am trying to do(except by the blue line moving)
    can you please give me a file it will be very useful

    I'm making this game that manages gravity points, I tried to make gravity lines but not accurate enough, well not as gravity points, and I thought It may be possible for a gravity point to go from one point to other in a way it turns into a very precise gravity line.

  7. #7
    Script kiddie VENGEANCE MX's Avatar
    Join Date
    Jun 2004
    Location
    England
    Posts
    2,590
    He's trying to do this:

    http://www.birchlabs.co.uk/MultipleVectors.swf

    Ignoring the 'multiple' vectors, which overcomplicates things a lot, we essentially just make a vector going from the chosen line (this line also being a vector) to the character, and project this vector onto that line. The dot product of this tells us how far along the line we are (in the example shown, it's the green line).

    To find out which side of the line we're on, we also project a vector of ourselves onto a line perpendicular to our line. The dot product of this gives us our blue line, which if positive says we're above the line, or if negative says we're below it.

    All we need are these two dot products. Based on observations of these values, we can decide whether or not you are above or below the line, or whether you've gone past - or not reached - it. This is all the information we need to either rotate it to its startpoint, endpoint, or perpendicular to the line itself.
    http://www.birchlabs.co.uk/
    You know you want to.

  8. #8
    Script kiddie VENGEANCE MX's Avatar
    Join Date
    Jun 2004
    Location
    England
    Posts
    2,590
    In fact...

    http://tonypa.pri.ee/vectors/tut08.html

    That any help?
    http://www.birchlabs.co.uk/
    You know you want to.

  9. #9
    talk to the hand! Never_land:('s Avatar
    Join Date
    Nov 2007
    Location
    your mother's bedroom
    Posts
    490
    thanks.

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

HTML5 Development Center