# Return Global Position From A Origin Of A Object X axis? (2D)

This topic is 3771 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Right now I am making a simple Pong Game Using Simple Math using C++ and OpenGL. Right now lets say the paddle is a at. 0.432 Y. This is the paddle origin. So I want the block on the side of the paddle too be 0.2 block length. So how can I get the positions of the blocked area through the origin so when the ball's X position goes through a if statement and I get the paddle's Y position it will determine the block area is with the paddle by it's origin. So if the ball interacts with the paddle the ball will simply revers. I haven't learned much Algebra so please be detail if you can. Thanks, Ajm113. [Edited by - ajm113 on March 21, 2008 1:17:21 AM]

##### Share on other sites
Your question is not at all clear. Can you try to rephrase it so that it's obvious what you're asking? It would appear that you're asking how to perform collision detection, but that doesn't have anything to do with the title of the thread, so I'm confused.

##### Share on other sites

So lets say the ball gets into the X axes where I want to check, but since I don't want too give the ball collision, but only use simple math by using object origins and determine what should happen in a position in a specific axis. So if the bat was in the same X origin by Y of the bat moving up or down was maybe a bit higher or lower then the incoming ball. It would detect the width's positions of the bat to determine if the ball will go backwards instead of the ball going through the bat.

It is collision detection, but also I want to know how can I determine a area of where the bat is at by Y axes and by the paddle width the ball should return or not when the ball gets at a specific X axes where a if statement will check and see if the ball would return to player 2 again.

1. 1
2. 2
Rutin
23
3. 3
JoeJ
20
4. 4
5. 5

• 29
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631740
• Total Posts
3001962
×