How do I rotate object on X or Y axis?

0 favourites
  • 9 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hello!

    I wonder if it was possible to rotate object on an other axis than Z! That all !

    Thank you !

  • You can't rotate a sprite or object on another axis , why you need that ? Paper mario clone :p ?

  • orugari :

    C2 isn't a 3D engine, so indeed you cannot spin around axis other than Z, however, you can simulate the other rotations, IF you only rotate one of them at a time

    exemple: https://dl.dropboxusercontent.com/u/100 ... index.html

    You might be able to simulate Z + one of the others, but not sure about that

  • Aphrodite I know it is not a 3D Engine :p But yeah I mistake explaining ! But your example is pretty what I wanted to do!

    Simulate rotating, things you can do with css3 and jquery (well, I did with css3 so it's why I wanted to know... ^^)

    is there a capx showing how to do this?

    Merci beaucoup

    vioz absolutly ahah :p

  • Aphrodite I know it is not a 3D Engine :p But yeah I mistake explaining ! But your example is pretty what I wanted to do!

    Simulate rotating, things you can do with css3 and jquery (well, I did with css3 so it's why I wanted to know... ^^)

    is there a capx showing how to do this?

    Merci beaucoup

    vioz absolutly ahah :p

    I was basically:

    Setting first two instance variables, ini_width and ini_height, to the sprite initial size

    setting a variable called X_Angle, and to rotate it, setting the height of the sprite to:

    Sprite.ini_height*cos(Sprite.X_Angle)

    And a similar operation for the height

    Depending on the origin point, you also might have to place the sprite correctly after (my exemple had it s origin first right in the center, then on the bottom left, which will affect the rotations)

    I may have time to do an exemple capx when I'll be on ly computer if you want one.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you for explanation!

    Well if reaaally you have time and motivation for it, I will take it with pleasure !

  • orugari : here it is: https://dl.dropboxusercontent.com/u/100 ... emple.capx

    It should be enough for a feeling of rotation, however keep in mind that since it is a not-so-precise illusion of rotation, precaution should be taken, also all objects are flats of course (but since you've explained it should be for a paper character feeling, should be good enough)

  • I thanks you thousand times! (but in the capx, nothing happend)

    I'll work on the function you gave me!

    Scirra has such a wonderful community ! (And bought my License yesterday, I am happy :p)

  • I thanks you thousand times! (but in the capx, nothing happend)

    I'll work on the function you gave me!

    Scirra has such a wonderful community ! (And bought my License yesterday, I am happy :p)

    Change the value of Angle_X and Angle_Y before previewing, I didn't add something to modify it automatically

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