The task is a kind of challenge, to determine on which diagonal the isometric cube is located

0 favourites
  • 3 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hello guys, the task blew my mind, maybe someone will be able to complete it.(sorry for my English)

    There is a random set of isometric cubes, the cube has a variable: "diagonal"

    It is necessary to automatically determine which diagonal each of them is on and assign the diagonal number to the cube variable.

    For clarity, I highlighted different diagonals with colors

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • How are you placing the cubes?

    If you are placing the cubes from isometric coordinates (ix,iy,iz) the diagonal would just be iy.

    As an example here is the math to project an isometric position (ix,iy,iz) to the screen (x,y):

    X=ix-iy

    Y=(ix+iy)/2-iz

    If instead you only have the xy positions of the cubes you can reverse the formulas above to get the iso position. But the iz value can be anything per cube.

    ix=y+x/2+iz

    iy=Y-x/2+iz

    Possibly you can look at the zorder and relative position of overlapping cubes to calculate the iso position too. But you’ll often have ambiguous solutions. For example if there isn’t a cube at the center intersection then it out guess four iy layers instead of three.

  • Thank you very much R0J0hound for your answer, you are great for helping people. In general, the answer is clear, and the problem really lies in iz. It seems that for this reason the ISO plugin does not have automatic placement of the zi parameter.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)