Answer the question
In order to leave comments, you need to log in
How to translate coordinates?
I'm trying to figure it out but I'm getting confused, as I understand there are 2 types of coordinates by cells and by pixels, I have 2 objects, they are for example at 2.2 and 2.3, I have 1 cell 100x100 when I move the object with the mouse, I have to translate its coordinates to pixels and move smoothly.
Question - How to get pixel coordinates and how to translate them back and forth?
That is, the object is at 2.2, but how to find out by pixels where it is?
And another object, for example, should move proportionally to the meeting, so I need to find out from it what coordinates it is located at (for example, at 2.3) and change its coordinates by pixels.
Tell me how and what, or where to read to understand how to manipulate them?
Answer the question
In order to leave comments, you need to log in
It is not clear what the coordinates of the cells are and where these cells are located.
And so - there are world coordinates, and screen ones. Mouse, wheelbarrow - work in the screen. Objects - in the world. Translate one into another through the ScreenToWorld camera methods and naborot.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question