Help creating formula (Graphing)

ItchyPancake

New member
Joined
Nov 19, 2014
Messages
1
Hey there! I am working on a video game and am using a formula to take an X & Y coordinate, and transfer it into an isometric coordinate.

isoX = x-y
isoY = (x+y)/2

That is my basic formula to calculate my new isometric coordinate. Now, the 2d objects that use this code are invisible, so all you see is the new isometric object.

When I click my mouse, I get the coordinates from the flat 2d graph, not the isometric one.

I want to be able to click, and transfer the (x,y) into the 2d graph based on the position from the isometric one.

So, if i'm correct, I would need to do that part by running those 2 formulas above, backwards!

But there is an issue!

the scale for isometric objects is 1:2 instead of your normal 1:1

Lets say x = 10 and y = 4
so,
isoX = 6
isoY = 7

Okay. Now, we want the reverse. If I click on the isometric coordinate of (6,7), The formula needs to convert the numbers back into (10,4)
BUT I can't figure out how.

The opposite of isoX = x-y
SHOULD be normalX = y+x

here is the issue.

normalx =6+7 = 13. I needed it to be 10, not 13

please help me! Haha, I really don't want to trash the isometric view.
 
Last edited:
Hey there! I am working on a video game and am using a formula to take an X & Y coordinate, and transfer it into an isometric coordinate.

isoX = x-y
isoY = (x+y)/2

That is my basic formula to calculate my new isometric coordinate. Now, the 2d objects that use this code are invisible, so all you see is the new isometric object.

When I click my mouse, I get the coordinates from the flat 2d graph, not the isometric one.

I want to be able to click, and transfer the (x,y) into the 2d graph based on the position from the isometric one.

So, if i'm correct, I would need to do that part by running those 2 formulas above, backwards!

But there is an issue!

the scale for isometric objects is 1:2 instead of your normal 1:1

Lets say x = 10 and y = 4
so,
isoX = 6
isoY = 7

Okay. Now, we want the reverse. If I click on the isometric coordinate of (6,7), The formula needs to convert the numbers back into (10,4)
BUT I can't figure out how.

The opposite of isoX = x-y
SHOULD be normalX = y+x
What do you mean by "normalX"? You say, you want the to reverse the calculation. I would have thought that the "normalX" was just the "x" corresponding to "isoX". If so, just changing the sign on y will certainly not do it! I don't know where you got that!

If that is indeed what you want, you want to "reverse" isoX= x- y and isoY= (x+ y)/2. Start by multiplying both side of the second equation by 2: 2isoY= x+ y. Now add that to isoX= x- y. The "+ y" and "- y" cancel leaving isoX+ 2isoY= 2x so x= (1/2)isoX+ isoY. Similarly, if we subtract isoX= x- y from 2isoY= x+ y so the x cancels and get 2isoY- isoX= 2y so y= isoY- (1/2)isoX.

here is the issue.

normalx =6+7 = 13. I needed it to be 10, not 13

please help me! Haha, I really don't want to trash the isometric view.

"Lets say x = 10 and y = 4
so,
isoX = 6
isoY = 7"

If isoX= 6 and isoY= 7 then x= (1/2)(6)+ 7= 3+ 7= 10 and y= 7- (1/2)(6)= 7- 3= 4. I is that what you wanted?
 
Top