Results 1 to 6 of 6
 11152011, 03:42 PM #1Senior Member
 Join Date
 Aug 2011
 Posts
 251
 Rep Power
 4
 11152011, 04:00 PM #2
Re: Calculate angels of a point object
want to calculate the x & y of a point object after it hits a frame.
You need to consider where the two shapes are located in 2 dimensions and see when the boundary of one shape touches the boundary of the other shape. Drawing this on paper will help you to see where the boundaries are and where the boundary of one touches the boundary of the other.
the angle of the point need to be multiplied in 1 after it hits a frame
Do you have some code you can post to show your problem?
 11152011, 04:02 PM #3
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 13,447
 Blog Entries
 7
 Rep Power
 20
Re: Calculate angels of a point object
If a point travels with a speed (dx, dy) toggle the sign of dx if the point hits a vertical wall; toggle the sign of dy if it hits a horizontal wall.
kind regards,
JosLast edited by JosAH; 11162011 at 08:19 AM. Reason: fixed a stupid typo ...
cenosillicaphobia: the fear for an empty beer glass
 11162011, 11:17 PM #4Senior Member
 Join Date
 Aug 2011
 Posts
 251
 Rep Power
 4
Re: Calculate angels of a point object
No, I'm drawing a shape that hits the window frames.
I know! I just trying to find a way to calculate the new values after the object confluenction.
Do you have some code you can post to show your problem?
Truthly, no.
I just got a simple point on my screen.
Looks like I got 2 problems now:
1)I want the point to move randomly on the screen. Moving it with 90 degrees it's easy .. just x++ or y++ but I want the point to move as the ball move on the picture I attached.
2)When it hits the window frame, what the values will be then?
Yea I know that but what happens if the ball is not re painting by x++ or y++, if it's x+=3, y+=10
Thanks guys.
edit: JoshAH, I think your answer is working for all the cases.
I will test it now.
 11162011, 11:26 PM #5
Re: Calculate angels of a point object
I want the point to move as the ball move on the picture I attached.
When it hits the window frame, what the values will be then?
Do you know the size of the window frame?
 11172011, 08:25 AM #6
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 13,447
 Blog Entries
 7
 Rep Power
 20
Similar Threads

Need help to calculate avg
By vavavoom1 in forum New To JavaReplies: 2Last Post: 04022011, 07:42 PM 
Calculate Interest
By hacikho in forum New To JavaReplies: 4Last Post: 10092010, 04:15 AM 
calculate fft
By ram.west in forum Advanced JavaReplies: 2Last Post: 08272008, 03:05 AM 
Calculate what e1 and e2 should be
By Legoland in forum New To JavaReplies: 11Last Post: 07022007, 06:01 PM
Bookmarks