Is it possible to flip / tilt a 3d shape?

0 favourites
  • 5 posts
From the Asset Store
Template for a basketball game with a 3D aspect (illusion of 3D)
  • I would like to have 3D playing cards in the game, that I can let fly around and flip like analog playing cards. I already set up a flat 3d object that represents a card, but now I am wondering if is actually possible to flip it around. Imagine having a card stack and turning the first card over to see whats on it.

    Can I flip / tilt a 3d shape, or will it always be facing in the same directions no matter what?

    If flipping is not possible, what options do I have? I was thinking about moving the camera instead, but I just want to flip one card over, not all of them.

    Is there a way to reach the same effect with just 2D? It would be really cool to see a flip animation / rotation and not just switch from the backside to the front in one frame.

  • So after trying out some stuff I came to this conclusion: technically it IS possible if you rotate the camera around the card, but I wonder if its worth the effort, because thinking in 3d space makes my brain melt.

    In another threat, someone linked a 2D animation example: construct.net/en/forum/construct-3/how-do-i-8/flip-card-object-156305

    And now I have to think about if I want to go the hard way or the easy way.

  • There is a free extension that was made recently to allow 3d objects to be rotated. Sorry i can't find the link right now, but its on here somewhere.

  • There's a third party 3d plugin that lets you load and rotate any 3d model.

    There's also a third party plugin that lets you rotate any object in 3d.

    You can also utilize distort meshes to do the rotation.

    Here is the only function you need to do rotation. Here it's just xy, but you can modify it to do xz or yz rotation. You can also combine them for a simplified expression.

    newX=x*cos(a)-y*sin(a)

    newY=x*sin(a)+y*cos(a)

    When using distort meshes the points xy position are defined in the 0-1 range so you'd map a layout xy to mesh with:

    meshX = (x-sprite.x)/sprite.width+0.5

    meshY = (y-sprite.y)/sprite.height+0.5

    The 0.5 is when the origin is centered.

    dropbox.com/scl/fi/o65y9e62zd2wmqko554ic/3d_card_flip.c3p

    To make the cards two sided it calculates the normal and does some math to see which side of the card is facing the camera.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you! I'll check it out as soon as I can :D that would be really awesome, because the 3D camera gives me lots of headscratches.

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