Jripe
- 8
- 0
How would you go about converting from a Cartesian coordinate plane to one where (0,0) is in the top left hand corner?
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.
PREREQUISITESGame developers, UI/UX designers, and software engineers working on graphical applications that require coordinate transformations and mouse interactions.
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?
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.