Announcement

Collapse
No announcement yet.

Creating a runtime rotation Gizmo

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    So. The way I did this recently is for a real time strategy camera, but the concept is nearly identical on objects.

    Create the mouse axis input and use it to determine if the mouse is moving and which direction it is headed on (based on axis).

    You can then create a positional vector and turn it along to the object you need to rotate.
    or you can just change the object's local rotation by adding 1 every time the event is called.

    You do need to isolate the initial node to keep it from constantly running.
    just do if axis!=0 > true > your local rotation logic.

    Rotating all 3 axis with only 2 movement axis won't exactly be possible.
    I would actually make an axis informed decision when dealing with x or y.
    If camera and object have the same X I would affect the Y - and viceversa...
    Z, the yaw, should probably always rotate with left to right...

    Leave a comment:


  • replied
    What exactly do you want to do? Rotate an object to match another's position? Ie. make it face another object?

    Leave a comment:


  • started a topic Creating a runtime rotation Gizmo

    Creating a runtime rotation Gizmo

    Hey everyone,

    I've been implementing a blueprint transform gizmo to translate and rotate actors at runtime in my build game. I have the translation working correctly, but I''m struggling with the rotation aspect. There's not a huge amount of info I could find online about how to do this. I'll post a couple of links to what I have found. From what I understand, the best way to do this is using quaternions, but my understanding of them is lacking a bit.

    The method described in this first link (https://nelari.us/post/gizmos/) doesn't use quaternions, but seems to just basically be a LookAt function between the actor and the ray-plane intersection. So the mouse must orbit the object to rotate it.

    his second explanation seems to be more what I'm after, but I'm struggling to grasp this and translate it to blueprint (https://computergraphics.stackexchan...rotation-gizmo).

    I have the Blueprint quaternion library plugin, so have access to a lot of quaternion functions if need be. Currently I'm creating a plane with a normal equal to the axis of rotation, and doing a line-plane intersection from the mouse position to find an intersection point on that plane. I just don't know how to translate the mouse movement to a rotation.

    Any help is much appreciated!
Working...
X