#(mrcrash) Item display rotate_left

28 messages ยท Page 1 of 1 (latest)

teal tundra
#

Hi,

I spawn 2 item_display entity to make a "cross"

But the sapling2 isn't rotated in game

https://paste.denizenscript.com/View/115237
https://paste.denizenscript.com/View/115236

tired lionBOT
#

(mrcrash) Item display rotate_left

tired lionBOT
#

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.

stone jewel
#

I don't fully get what you mean by cross, but:

    - define location <player.location.with_pose[0,0]>
    - spawn item_display[item=oak_sapling] <[location]>
    - spawn item_display[item=oak_sapling] <[location]> save:sapling
    - define sapling <entry[sapling].spawned_entity>

    - adjust <[sapling]> left_rotation:<location[0,1,0].to_axis_angle_quaternion[<element[90].to_radians>]>```
The input in the location constructor (in this case `0,1,0`) is the axis you're rotating the entity around
`1,0,0` is the x axis, `0,1,0` is the y axis etc.
teal tundra
#

This is exactly what I wanted to do, thank you

I didn't know that the location constructor set rotation

stone jewel
#

you can use <location[0,1,0].to_axis_angle_quaternion[<element[90].to_radians>]> then

#

it rotates it 90 degrees around y

teal tundra
#

Okay so

#

with - adjust <entry[sapling2].spawned_entity> interpolation_duration:0t - adjust <entry[sapling2].spawned_entity> interpolation_start:0 - adjust <entry[sapling2].spawned_entity> left_rotation:<location[0,1,0].to_axis_angle_quaternion[<element[90].to_radians>]>

#

that work, but the entity isn't rotate instantly, look like the interpolation_duration don't take 0t

stone jewel
#

why are you interpolating it?

#

If you want it to instantly rotate, spawn it with the left rotation applied

teal tundra
#

Uh i don't know how to do that

#

each time i want to adjust a display entity mech i use interpolation ๐Ÿ˜

stone jewel
#
    - define location <player.location.with_pose[0,0].center>
    #define the rotation quat
    - define q <location[0,1,0].to_axis_angle_quaternion[<element[90].to_radians>]>

    - spawn item_display[item=oak_sapling] <[location]>
    #spawn it with the left rotation applied
    - spawn item_display[item=oak_sapling;left_rotation=<[q]>] <[location]>```
teal tundra
#

Okay, really usefull, usually i put this sort of mech inside the entity script

#

but yeah, better to make a genereic entity script and adjust it on spawning btw

stone jewel
#

You can do that, I'm just giving you an example

stone jewel
#

to my understanding, interpolation is to smoothly transition between two values

teal tundra
#

so i can use a mech only for display entity withut interpolation, like the left_rotate

stone jewel
#

yeah

teal tundra
#

okayyy

#

Thank's you ๐Ÿ™‚

stone jewel
#

np

teal tundra
#

time to resolve it !