Skip to main content

Search

Rotate X grades using a variable

  • TheBeardyMan

    You can use a Timeline with five Keyframes to record the object's rotation at five points and a Signal Manipulator to scale the value of your variable from -180 -> +180 to 0.0 -> 1.0. Here are the steps to do that:

    1. Enable the grid snap guide.
    2. Create a Timeline.
    3. Open the Timeline's canvas.
    4. Set the left edge of the Timeline to slightly less than -1 second.
    5. Set the right edge of the Timeline to slightly more than +1 second.
    6. Zoom the Timeline canvas in until you can see individual frames.
    7. Adjust the left trim of the Timeline to exactly -30 frames.
    8. Adjust the right trim of the Timeline to exactly +30 frames.
    9. Create and start recording a Keyframe at the centre of the Timeline (0 frames).
    10. Press L2 while hovering over your object to record its current position.
    11. Stop recording.
    12. Narrow the Keyframe until it occupies less than 1 frame.
    13. Open the Keyframe's tweak menu.
    14. Set the Keyframe's blend to linear.
    15. Turn off the Keyframe's smoothing.
    16. Close the Keyframe's tweak menu.
    17. Create a clone of the Keyframe at -15 frames on the Timeline.
    18. Re-record the second Keyframe.
    19. Rotate the object counterclockwise about its axis by 90 degrees.
    20. Stop recording.
    21. Narrow the second Keyframe until it occupies less than 1 frame.
    22. Create a clone of the second Keyframe at -30 frames on the Timeline.
    23. Re-record the third Keyframe.
    24. Rotate the object counterclockwise about its axis by a further 90 degrees.
    25. Stop recording.
    26. Narrow the third Keyframe until it occupies less than 1 frame.
    27. Create a clone of the first Keyframe at +15 frames on the Timeline.
    28. Re-record the fourth Keyframe.
    29. Rotate the object clockwise about its axis by 90 degrees.
    30. Stop recording.
    31. Narrow the fourth Keyframe until it occupies less than 1 frame.
    32. Create a clone of the fourth Keyframe at +30 frames on the Timeline.
    33. Re-record the fifth Keyframe.
    34. Rotate the object clockwise about its axis by a further 90 degrees.
    35. Stop recording.
    36. Narrow the fifth Keyframe until it occupies less than 1 frame.
    37. Create a Signal Manipulator.
    38. Open the Signal Manipulator's tweak menu.
    39. Set the Signal Manipulator's remap type to custom remap.
    40. Set the Signal Manipulator's input upper threshold to +180.
    41. Set the Signal Manipulator's input lower threshold to -180.
    42. Wire the Signal Manipulator's signal output to the Timeline's playhead input.
    43. Wire the value of your variable - either from the Variable gadget itself or from a Variable Manipulator gadget with the get operation - to the signal input of the Signal Manipulator.

  • Nasic

    Thanks

    It's a great idea. But I would like to do it without creating a timeline.

    Could I do it with a tool like "look at rotator" or something similar?

    It is preferable for me.

  • TAPgiles
    Great answers

    You'd have to then convert an angle into a direction to use for the look at rotator. Dreams doesn't have trigonometric functions as part of the calculator, but there are solutions people have made for that. They just tend to be a bit heavy on thermo, because those functions aren't straightforward. Try the dreamiverse, or you can check out my solution: https://indreams.me/element/oJkcjzRszmn

  • Nasic

    I will take a look. Thanks a lot.

    I proposed the "look at rotator" tool because it has a "scene space direction" option, and maybe, I could use it in some way, but I don't know how ...

  • TAPgiles
    Great answers

    Why do you want to avoid timelines though, by the way? I use them for all sorts of logic. They're super useful!

  • OgTheEnigma

    You can do it with a Look At Rotator's Screen Space Direction.

    Use Vyzium's Sine & Cosine gadget. Input your angle, and you'll have 2 output lengths, from sin and cos, with an implied max distance of 1. Connect these 2 values to a 3 number Combiner. The 2 inputs you choose will correlate with pitch, roll and yaw. Choosing the same 2 inputs, but connecting the wires in the opposite positions will make it rotate the other direction, with the same angle input.

    Connect the Combiner to the Screen Space Direction on the Look At Rotator to apply it to your object.

  • Nasic

    "Why do you want to avoid timelines though, by the way? I use them for all sorts of logic. They're super useful!"

    The problem with using animation points is that it also saves me the spatial position of the scene, not just the rotation. That is, my element is an object that moves in space, and if I activate the animation point where I rotate that element, it not only rotates it, it also transfers it to the X, X, X coordinates in which I have created that animation.

     

    "You can do it with a Look At Rotator's Screen Space Direction."

    Ok, i Will try, thanks a lot.

  • OgTheEnigma

    "The problem with using animation points is that it also saves me the spatial position of the scene, not just the rotation. That is, my element is an object that moves in space, and if I activate the animation point where I rotate that element, it not only rotates it, it also transfers it to the X, X, X coordinates in which I have created that animation."

    Just a note, that Keyframe animation rotations and positions are group relative. So you only need to rotate an object inside a group. This will not affect the position of the group, meaning you can move the external group around, while rotating the inner object.

  • TAPgiles
    Great answers

    ^ This.

    It's no issue with timelines or keyframes. Just keyframe it inside a group and it won't matter that it's fixed in place within that group; because you can move the group anywhere, separate to that.

  • Nasic

    "Just a note, that Keyframe animation rotations and positions are group relative. So you only need to rotate an object inside a group. This will not affect the position of the group, meaning you can move the external group around, while rotating the inner object."

    I know, but I'm trying to save as much as possible on the thermometer.

    In fact, the element I am talking about is a chip, alone, and "in the air". So to do it that way, I would need to create extra elements (objects) and that's what I want to avoid ...

  • Nasic

    Finally I have used the solution of "TheBeardyMan" to do what I wanted, with some changes adapted to my needs.

    So thanks!!!

Please sign in to leave a comment.