Converting between coordinate planes

  • Thread starter Thread starter Jripe
  • Start date Start date
  • Tags Tags
    Coordinate Planes
Click For Summary
SUMMARY

This discussion focuses on converting Cartesian coordinates to a coordinate system where the origin (0,0) is positioned at the top left corner of the screen. The original poster (OP) describes a scenario involving an object within a nested screen setup, where mouse coordinates need to be translated from the smaller screen's origin to the larger screen's origin. Key insights include the necessity of adjusting coordinate axes and considering the screen dimensions to accurately compute the mouse's relative position. The OP contemplates the mathematical adjustments needed for accurate coordinate transformation.

PREREQUISITES
  • Understanding of Cartesian coordinate systems
  • Familiarity with screen coordinate systems in graphical applications
  • Basic knowledge of coordinate transformations
  • Experience with programming concepts related to object movement and positioning
NEXT STEPS
  • Research coordinate transformation techniques in graphical programming
  • Learn about the implementation of mouse event handling in GUI frameworks
  • Explore mathematical concepts related to shifting coordinate axes
  • Investigate the use of libraries for handling 2D graphics and coordinates
USEFUL FOR

Game developers, UI/UX designers, and software engineers working on graphical applications that require coordinate transformations and mouse interactions.

Jripe
Messages
8
Reaction score
0
How would you go about converting from a Cartesian coordinate plane to one where (0,0) is in the top left hand corner?
 
Physics news on Phys.org
Jripe said:
How would you go about converting from a Cartesian coordinate plane to one where (0,0) is in the top left hand corner?

What do you mean by the origin being in the top left hand corner?
 
Like this:
30ms3k2.gif
 

Attachments

  • 30ms3k2.gif
    30ms3k2.gif
    2.6 KB · Views: 473
It's still pretty much the same cartesian plane, I guess it's just resized because for whatever purpose that is needed for only requires the fourth quadrant.
 
Ok.. maybe I should have put my question a bit better, with a bit more info on what I need this for.

What I have is an object, inside a screen, that is inside another screen. The object can move, and the screen inside the screen is partially-fixed onto the object. If I move the mouse to the left, the screen will follow it to the left, up until the object is on the very right side of the screen which stops it from moving further.

The objects coordinates are based on the large screens origin, and my mouse coordinates are based on the smaller screens plane, which starts in the top left 0,0.

What I am trying to do is to get the mouses coordinates relative to the larger screen.
 
Jripe said:
Ok.. maybe I should have put my question a bit better, with a bit more info on what I need this for.

What I have is an object, inside a screen, that is inside another screen. The object can move, and the screen inside the screen is partially-fixed onto the object. If I move the mouse to the left, the screen will follow it to the left, up until the object is on the very right side of the screen which stops it from moving further.

The objects coordinates are based on the large screens origin, and my mouse coordinates are based on the smaller screens plane, which starts in the top left 0,0.

What I am trying to do is to get the mouses coordinates relative to the larger screen.

I guess you could shift the coordinate axes of the upper left coordinate point to be (0,0) and adjust all other points accordingly.
 
OP,
Have you got any ideas on how you could accomplish this?
 
I'm getting there. I started off by thinking that if the mouse was at say, (0,0) then it would be a whole screen distance up and to the left so I would say distance x = Screen size - 0 and distance y = Screen size - 0 up until half of the screen. I realize now that this would only work at the maximums (I think) because as you go towards the middle you would be getting half the screen size, which isn't what I want.

I am about to go to bed, so I will give this a bit of thought while going to sleep and then continue on tommorow.

Oh, one other thing I forgot to mention is that up is -ve and down is +ve, right is +ve and left is -ve for the objects coordinates relative to the large screen.

After a little bit of brainstorming, maybe the distance from the middle of the screen. I'm done. Bed.
 
Last edited:

Similar threads

Replies
20
Views
4K
Replies
7
Views
2K
Replies
1
Views
2K
Replies
8
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 51 ·
2
Replies
51
Views
6K
Replies
9
Views
881
  • · Replies 1 ·
Replies
1
Views
2K