#Rotating item displays around a coordinate

1 messages · Page 1 of 1 (latest)

long meadow
#

Im trying to make that turn like a wheel. But i cant get the end rod item displays to turn around anything but their center.

gilded stratus
long meadow
#

@gilded stratus all my code does is make the iron block rotate

gilded stratus
#

Why are u turning the iron block when u want to create a wheel effect???

#

Don’t you need to move the end rods

long meadow
#

i need to move both

#

but the end rods need to move different

gilded stratus
#

Oh.. have you tried anything yet

long meadow
#

they need to rotate around iron block

#

umm

#

some guy told me to use quaternions but i have no idea what happened everything kinda broke

gilded stratus
#

Weird.. I can’t help without code though 💀

long meadow
#
        loop 90 times:
            add -1/100 to {_loopvalue}
            if pitch of {wheelcenter} is -90:
                set pitch of {wheelcenter} to 0
            add 5 to pitch of {wheelcenter}
            set display right rotation of {rod1} to {_loopvalue}
#

there

#

thats the rotation part

gilded stratus
#

You have tried the same with the end rods right

#

Maybe u gotta change all numbers and do all 4 rods so -360 and change some other numbers try experimenting

long meadow
#

thats not helpful 😦

#

u just said experiment

#

bruh

#

😦 please help me

gilded stratus
#

It’s 3am for me… and I am on iPhone

#

I can’t help

bitter venture
#

Well you gotta actually teleport those end rods aswell

#

Otherwise if ur just changing pitch like in that code. It will rotate around themselves

long meadow
#

i was told the only way to do this was quaternions

#

does anyone understand those?

bitter venture
#

What is that

void night
#

quaternions are difficult to manage by themselves, typically you use a helper function like this or this
quaternions as a math concept can be fairly complex - you can read up more online about how they work

#

try modifying one of these functions i had laying around and learn how it works:
set display left rotation of %entity% to axisAngle(45 * (3.14 / 180), 10 * (3.14 / 180), 1, 0)

white fable
#

i suppose this is a cold comfort but when skript display pr releases you can use rotate {_display} around {_some vector} by 5 degrees

white fable
#

with 2.10 in january
but the nightly is available now

summer trellis
void night
#

no
the pr relating to block displays

#

pr = pull request
to the actual skript code

long meadow
#

I figured it out

sleek berry
#

its easy

#

use translation and rotate ther yaw or pitch or whatever

stark pond
# void night quaternions are difficult to manage by themselves, typically you use a helper fu...

Quaternions aren't complex by themselves. They're just hypercomplex numbers with one real component and three imaginary components. Most basic concepts of them are the same as in complex world.
What makes them difficult to understand are their applications such as rotations where the real component is used as a rotation angle and imaginary components represent the vector being the axis of rotation.

#

I could talk about multiplication not being commutative, but an average user won't even think of multiplying them.

#

They're just a neat alternative for rotation matrices.

#

I may have taken it a bit too far, but my point was to show that they're a great mathematical tool which can be used with ease.

white fable
#

i also think it's kind of silly that they're explained as having imaginary numbers
it's much easier to think of them as simple 4 dimensional vectors, like a 3d vector but with 1 more number

#

there's nothing really inherent to them that forces you to know about imaginary numbers

#

all you need to know is sin and cos
or even just use axisAngle objects constantly

stark pond
#

Both interpretations are mathematically correct. You either interpret i, j, k as a vector space basis or imaginary units.

#

It's the same as in imaginary world. You can interpret complex numbers as 2D vectors or points somewhere placed on the Gauss' plane.

#

Even real numbers can be interpreted as one-dimensional vectors.

stark pond
white fable
#

but online and sometimes here it's always "real and imaginary parts"

#

and it's like that's just making it harder than it needs to be

stark pond
#

I don't think it's easy to explain a four-dimensional vector...

white fable
#

it's really easy
everyone is used to 3d vectors

#

just tell em there's a fourth number in it

stark pond
#

From my experience, most scripters (some plugin developers too) don't know what vectors are.

white fable
#

they know what locations are

stark pond
#

But eh... let's not complain.

stark pond
white fable
#

the way quaternions are introduced to people who don't have high level education in math

#

the vast majority of people don't know what imaginary numbers are or just know that i is the sqrt of -1

#

but they understand x y and z

stark pond
#

Well, that's what happens when programmers and mathematicians meet.

white fable
#

exactly, which is what i'm talking about

stark pond
#

My preferred way of teaching is first telling the boring theory and if a person or a group of people don't understand, I keep simplifying it step by step until they get a grasp of it.

#

Discarding a whole theory at the very beginning is a bit too much in my opinion.

white fable
#

which is fine if you're both invested in it
if the other party is scared off by mention of imaginary numbers and decides that they don't need to learn what a quaternion is, or that they can't, then you have a problem

stark pond
#

Although I'm pretty sure my point of view is biased as I generally don't speak to people not familiar with math.

white fable
#

which is what i've encountered quite a bit here when talking about quaternions

stark pond
#

I see. Well, as I said before, I may have taken it a bit too far, but still, it's good to talk about such things. Hearing out other people's opinions does wonders.

white fable
#

oh i didn't mean to target this at you

#

i was just speaking in general

stark pond
#

Actually, I wondered if I should make a PR to Skript's repository adding some matrix related operations, but I suppose I should leave it to math-focused addons.

#

And I guess TheOneWizard is mainly working on bringing the beauty of math to other folks out here.

stark pond
white fable
stark pond
#

The only application would be rotation matrices, but using them is a pain in the rear. That's exactly why quaternions come in handy.

#

I can totally imagine Skript users getting along with it.

white fable
#

lmao

stark pond
#

Alright. Time to go to sleep. Thanks for a nice talk Sovde, I enjoyed it. Have a good night.