#(Krilliant) rotate an item display smoothly

30 messages · Page 1 of 1 (latest)

unreal birch
#

i've been searching about quaternions here, and i found this thread: https://discord.com/channels/315163488085475337/1300034306034368603

pretty helpful, gave me a starting point. but, as the thread states, i have to insert a little wait (in my testings, of 2 ticks) so the rotation doesn't invert itself. creating a noticeable halt in the movement (embed video)

i've seen servers and datapacks do seamless infinite rotations. how would i achieve that through denizen?

my current script: https://paste.denizenscript.com/View/138456

scenic irisBOT
#

(Krilliant) rotate an item display smoothly

scenic irisBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

unreal birch
#

oops, fixing vid rn

fleet hull
#

have a fixed increment on the ent's left rotation maybe

#

instead of the base angle approach

unreal birch
#

i can see the logic behind it, but with what tags can i do that? im a total noob when it comes to quats

fleet hull
unreal birch
#

oh yeah definitely

#

how'd you do it

fleet hull
#
bdf2:
  type: task
  debug: false
  script:
  - spawn skills_bola_de_fogo_entity <server.online_players.first.location.above.forward_flat[2].with_pose[0,0]> save:b
  - wait 3t
  - define ent <entry[b].spawned_entity>
  - define z_rot <location[0,0,1].to_axis_angle_quaternion[<element[72].to_radians>]>
  - repeat 40:
    - adjust <[ent]> left_rotation:<[ent].left_rotation.mul[<[z_rot]>].normalize>
    - adjust <[ent]> interpolation_start:0t
    - wait 10t
  - remove <[ent]>```
#

i changed the interp duration mech on the base ent to 10t

#

but the wait is just whatever that value is

#

is that all

#

can my test server go back to hibernation now

unreal birch
#

can i ask why you did 72 degrees instead of 180

#

like whats the logic behind it? i noticed using other values sometimes worked and sometimes didnt

unreal birch
fleet hull
#

ahem

#

sometimes it tweaks at 180, if u keep adding the rotation it spins itself back and forth

#

a smaller increment looks smoother anyway

#

there's probably some math behind it but i would not bother to understand it

unreal birch
#

quats are basically magic

unreal birch
#

thanks my brotha