Results 1 to 15 of 15

Thread: Move pictures accross line to time

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    332

    Move pictures accross line to time

    I would like to move a picture accross a line to time.

    For example, drawing a line with each end A and B respectively.
    I would like to append the picture (most probably a tiny dot) to the line, starting from A, and move it to B over a certain period of time.

    The problem is, how do I make the dot move exactly on the line to B, so that it also reaches B by the time I specify?

    Any ideas ppl on how I can code this?

  2. #2
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    well just get the slope of the line
    than you would have some easy function
    f(x)=mx+c
    than you can just get the position for the pic by putting the x value

    now you want to do it over time so you just devide x by the total time and take it times the actual time.
    should work I guess
    Sanity is a full time job

    Puh das war harter Stoff!

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    332
    wat can i get from that equation? the slope?
    i tot the slope doesn't represent the measurement of the line?
    the slope is the gradiant?

    er.....could you elaborate? i do not know how to relate this to code...

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    332
    hm.....this formula requires coordinates. the thing is, i don't have coordinates to make use of!

    yeah
    how do i use the timer? i did have that in mind to move the pic a long the line as time goes by, but how?

    anyway, i'm still puzzled at how i could implement the formula you stated earlier on...

  5. #5
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    well don't you have the coordiantes of your points A and B? how are they represented than?
    Sanity is a full time job

    Puh das war harter Stoff!

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    332
    i used A and B just as an illustration of the 2 end points of that particular line. In reality, its just a line placed on either a form or a picture box...

  7. #7
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    well every line placed (using a control or the drawline)
    has a 2 points for its start and end.

    for the control it would be x1,y1 and x2,y2
    Sanity is a full time job

    Puh das war harter Stoff!

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    332
    er...okok, i get it,

    is there a way to draw crooked lines in vb?

    if so, anyway, i can't use y = mx + c anymore!

    so is there any pre-built in function which i can use for crooked lines?

  9. #9
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    well if you draw them yourself you could use any mathematical function so you could also follow it if you know how the fuction looked like
    I do not know about any bezier or similar things in VB, but I am sure there is a way.
    And of course if the line is just pixels on a picturebox or something similar you could draw any shape on there...

    well got to go to school...
    Sanity is a full time job

    Puh das war harter Stoff!

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    332
    er....ok,i think its best to abandon the idea of using functions for this cause, er...........

    any other ideas ppl to move an object a long a line?

    i'm sure there should be codes to achieve this purpose...

  11. #11
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    well how is the line specified in your program yet?
    It is not straight right, so is it saved as a bunch of coordinates (vectors) or is it just pixels?
    Sanity is a full time job

    Puh das war harter Stoff!

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    332
    yeap
    its on pixels, so i really dunno wat to do next...

  13. #13
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    well since every pixel is kind of connected to the last one you could program some algorithm that checks where the next point is and move there.
    (Fox made something like that. should be interesting for you)
    Sanity is a full time job

    Puh das war harter Stoff!

  14. #14

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    332
    wow, is there anyawy i can avoid using Fox and just use vb to achieve my purpose?

  15. #15
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    haha I mean the guy called fox on this forum
    he doesn't seem to be around right now.
    I don't know but look for him on the members list he used to be real active in this forum.
    Sanity is a full time job

    Puh das war harter Stoff!

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