Isometric Projection

0 favourites
From the Asset Store
Build your map with these isometric objects and terrains
  • Lets say I want to make an Isometric "3D" star map that I want to rotate. I want it to appear that all points on this "map" rotate around the y axis as the map turns. This involves Isometric Projection mathematics...

    Has anyone worked out how to translate this math into Construct 2 yet?

    I was thinking of using the "math" to translate sprite x,y,z (isometric) to x,y (Construct Canvas) as the map rotates. I imagine it would be a complex event structure...

    I would probably give a sprite local variable ISOx, ISOy, and ISOz for Isometric point in space, then ProjX, and ProjY for the 2D projection position on the layer.

    Then I guess I would have to calculate at what angle the map was facing isometrically, and use that to calculate ISOx, ISOy, and ISOz. Then use Isometric projection to translate the "false" x,y,z to ProjX and ProjY...

    Am I on the right track? Anyone want to help me figure this problem out?

  • use unity :D

    seriously for 3D stuff you're better off using an engine dedicated for that.

    There are solution for 2D isometric, r0j0 posted a neat cap some month ago on filmation.

    But it's still a pain to use.

    If you use a 3D engine you will have less constraint and it might not be that complicated.

  • <img src="smileys/smiley36.gif" border="0" align="middle" /> - I thought you would say that. Never mind :) <img src="smileys/smiley36.gif" border="0" align="middle" />

  • The math isn't too complex:

    http://dl.dropbox.com/u/5426011/examples%208/zrotate.capx

    If you want it to just rotate relative to the screen remove the "set y" actions.

  • oh neat :D...

    now the "Star map" makes more sens to me :D

  • The math isn't too complex:

    http://dl.dropbox.com/u/5426011/examples%208/zrotate.capx

    If you want it to just rotate relative to the screen remove the "set y" actions.

    THAT IS EXACTLY WHAT I WANTED!   Very clever. Thanks ROJOhound! <img src="smileys/smiley32.gif" border="0" align="middle">

  • OK, So now I want to get a Distance value between two stars. I have Local PlotX, PlotY and PlotZ values for each star instance. These are recorded when the star is placed in the Isometric spinning Star map. When you left Click on one star it records the instance and pulls those values. Then you click on a star with the right mouse button and it pulls a second set of coordinates. The Distance Global variable then tallies the distance. But if Global DistanceAB is Negative, it says NaN (because of sqrt I think)...   How can I get that value regardless of whether the value is + or -...

    Take a look. It is kinda cool looking... (Think about the cool spinning art you could create with this principle...)

    http://www.box.com/s/se75ku9mcgxxa5kevdkl

  • how a nice examples !

  • Zetar that is wow man thanks

  • zrotate.capx doesn't make sense to me... how does getting the sin and cos of 1 over and over get you angular motion? Shouldn't it be the sin and cos of an increasing angle?... but when you change that constant it just changes the speed of the rotation. Does cos(1) not work like I think it does? Shouldn't it return 1 all the time?

  • You get the motion because x and z are being changed every time and their values are used in the formulas.

    Here is the reference I used:

    http://www.siggraph.org/education/materials/HyperGraph/modeling/mod_tran/2drota.htm

  • I played around with my original capx and came up with a few adjustments. It will now spawn 3 spherical solar systems at random locations in the window with a y rotational axis, and different rotational speeds. Looks neat...

    app.box.com/s/1wg9v4gwqel5ligldu0d

  • OH ok we're talkin' about the angle of rotation...delta angle... which is a constant... not the total angle.

    x is always going to be R*cos(angle) but if we're going from x to x' then it's

    the derivative of Rcos(angle) which is cos(angle)^2-Rsin(angle)^2

    R*cos(angle)*cos(angle) - R*sin(angle)*sin(angle)

    substituting since y=r*sin(angle) we can substitute and get

    R*cos(angle)*cos(angle) -y*sin(angle)

    and since x = cos(angle) [I'm taking baby steps here]

    we can substitute more

    x*cos(angle)-y*sin(angle)

    BOOM!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ugh... My head hurts now... I am glad someone is learning from this post. LOL!!!! (P.S. Im still not 100% on it myself, but at least I understand the basics.

  • I don't fully get how they come up with the second part either, the derivative... I just looked it up and it's that. There's a proof but phew I'm glad someone else did it.

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