|
-
Feb 20th, 2002, 05:50 AM
#1
Thread Starter
Hyperactive Member
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?
-
Feb 20th, 2002, 08:15 AM
#2
Frenzied Member
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!
-
Feb 20th, 2002, 08:59 AM
#3
Thread Starter
Hyperactive Member
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...
-
Feb 20th, 2002, 10:16 AM
#4
Thread Starter
Hyperactive Member
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...
-
Feb 20th, 2002, 10:50 AM
#5
Frenzied Member
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!
-
Feb 20th, 2002, 11:32 AM
#6
Thread Starter
Hyperactive Member
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...
-
Feb 20th, 2002, 11:47 AM
#7
Frenzied Member
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!
-
Feb 20th, 2002, 11:26 PM
#8
Thread Starter
Hyperactive Member
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?
-
Feb 21st, 2002, 01:29 AM
#9
Frenzied Member
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!
-
Feb 21st, 2002, 02:27 AM
#10
Thread Starter
Hyperactive Member
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...
-
Feb 21st, 2002, 07:29 AM
#11
Frenzied Member
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!
-
Feb 21st, 2002, 07:54 AM
#12
Thread Starter
Hyperactive Member
yeap
its on pixels, so i really dunno wat to do next...
-
Feb 21st, 2002, 09:50 AM
#13
Frenzied Member
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!
-
Feb 21st, 2002, 10:28 AM
#14
Thread Starter
Hyperactive Member
wow, is there anyawy i can avoid using Fox and just use vb to achieve my purpose?
-
Feb 21st, 2002, 11:02 AM
#15
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|