ToEE Isometric Transformation

Discussion in 'Tech Guides and Help Threads' started by anatoliy, Nov 10, 2017.

Remove all ads!
  1. anatoliy

    anatoliy Member

    Joined:
    Feb 18, 2017
    Messages:
    81
    Likes Received:
    2
    Hi

    I've been researching ToEE's isometric transformation for one week now. This is what I got.

    From ViewPort (screen) to Isometric (Ground Map) steps:
    0. Starting from default top left origin, X to right, Y to bottom.
    [​IMG]

    1. Apply "Flip X" transformation.
    [​IMG]

    2. Apply "Rotate 45 grad anticlockwise" transformation.
    [​IMG]

    3. Apply "Scale Y 1->0.7055" transformation.
    [​IMG]
     
    Last edited: Nov 10, 2017
  2. anatoliy

    anatoliy Member

    Joined:
    Feb 18, 2017
    Messages:
    81
    Likes Received:
    2
    Math

    Code:
    "Apply" means "matrix multiplication".
    
    0. Starting from default top left origin, X to right, Y to bottom.
    ( (1, 0)
    , ( 0, 1) )
    
    1. Apply "Flip X" transformation.
    ( (-1, 0)
    , ( 0, 1) )
    
    2. Apply "Rotate (Z-Axis) 45 grad anticlockwise" transformation.
    ( ( cos(45), sin(45))
    , (-sin(45), cos(45)) )
    
    which is
    ( ( 0.7071, 0.7071)
    , (-0.7071, 0.7071) )
    
    3. Apply "Scale Y 1->0.7055" transformation. (math matrix multiplication)
    ( (1, 0)
    , ( 0, 0.7055) )
    
    Result MatrixT is
    ( (A: -0.7071, B: 0.7071)
    , (P: 0.4989, Q: 0.4989) )
    
    P2.X = P1.X * MatrixT.A + P1.Y * MatrixT.B
    P2.Y = P1.X * MatrixT.P + P1.Y * MatrixT.Q
    
    ==>
    P2.X = P1.X * -0.7071 + P1.Y * 0.7071
    P2.Y = P1.X * 0.4989 + P1.Y * 0.4989
    
    
    Edit:
    Fixed float to double transformation.
     
    Last edited: Nov 10, 2017
Our Host!