How do I rotate a 3D object on the Z axis?

1 favourites
  • 5 posts
From the Asset Store
Simple resize and rotate events for any sprite, quick and easy event sheet that you can use for your own projects.
  • Hi,

    I have been trying to make a 3D FPS in construct 3, and my main issue recently has been trying to get the bullet rotate to where you are looking on the Z axis as well as the X and Y. I can get it to rotate on the X and Y, but I can't get it to follow your view on the Z as well. please explain to me If this is possible, if I need to install a plugin (and please provide a link to said plugin), or if I should just give up now.

  • It is possible.

    I do not recommend pursuing this endeavor though, if you lack the math to figure out this step. You're only going to run into more difficult issues as you proceed.

  • It is possible.

    I do not recommend pursuing this endeavor though, if you lack the math to figure out this step. You're only going to run into more difficult issues as you proceed.

    thanks, I really want to at least get that working, could you explain the math to me? if I run into any issues further down the line, it's okay.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The height of the bullet at any given point is equal to the cosine of the vertical angle of the direction the camera is facing multiplied by the distance between the camera position and the bullet.

  • Hmm... I think 3D questions are confusing in general because there are lots of ways to describe things and often the questions aren’t clear.

    Unless I’m understanding wrong you are just looking for a way to rotate 3D objects on other axises? The answer you got so far looks like the start of a way to position the object at an angle from the camera, which is useful but doesn’t change the objects actual rotation.

    For 3D objects you can only rotate on the z-axis, (or on the xy plane). Construct doesn’t provide a way to rotate them any other way.

    The 3D camera can be rotated any way, but not directly. Basically the lookAt action can be used to get any rotation.

    There is a 3D third party plugin by mikal (I don’t have a link but it’s updated regularly) that lets you rotate 3D meshes on other axises too. Hopefully it has a lookAt action to allow the objects to face the camera.

    For a free solution you can make up 3D meshes with sprites using distort meshes. The orientation (or 3D rotation) of the object is a 3x3 matrix which can be represented by a 3x3 array or 9 variables. Anyways, the maths bit is needing to use matrix multiplication to apply rotation.

    RotatedVector = vector x orientation.

    Of course we can only do math with numbers, not vectors and matrices so you’ll have to expand the equations per vector component.

    Search the forum for recent posts by me for some examples of this.

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