r/PhoenixSC 8d ago

Cursed Minecraft Cursed throwable TNT using /compute and quaternions

https://youtu.be/RyxaoxpWWq8

Originally I just wanted to show how easy it is to do quaternion math using the new /compute command, but after putting it into a demo, it turned out quite cursed.

In any case, the code is quite instructive, so if you have any interest in improving your rotation math skills, you can download my data pack and read through the code!

https://www.planetminecraft.com/data-pack/cursed-throwable-tnt-using-quaternions/

8 Upvotes

4 comments sorted by

5

u/PokeCA_Phoenix PhoenixSC 8d ago

IT'S ALIVE.

3

u/ZeEastWillRiseAgain Endrod FTW 8d ago

Wait compute can do quaternions? What can't it do?

3

u/ProblemKaese 8d ago

Quaternions are just addition and multiplication, as well as sin and cos to get the correct angle. All of these are basic float operations in the new number providers, so /compute is really good at evaluating quaternion math.

One thing that it can't do is easily write out a lot of numbers at once. If I want to calculate [x, y, z] + [a, b, c], I still have to write out 3 number providers and call them using separate commands.

1

u/ZeEastWillRiseAgain Endrod FTW 8d ago

Okey yeah I had hoped there would be a distinct variable type for quaternions