#quaternion

1 messages · Page 1 of 1 (latest)

random oasis
#

How i extract pitch from quaternion?

i tried

float pitch = math.degrees(math.asin(2.0f * ((q.y * q.w) - (q.x * q.z))));

but it gives results between -90 and 90

not 0-360

steel dagger
#

Pitch is actually supposed to between -90 to 90
Because if it exceeds that range it can be represented with 180 degree rotated Yaw

#

As in (120, 0, 0) is same as (60, 180, 180)

random oasis
#

Do you know how do i combine it to get 0 to 360?

#

My game is topdown and i need only pitch rotation

#

I want to send it over network and i don`t need to send a full quaternion but only pitch

#

what i need is Y of euler angles

simple compass
random oasis
#

How do i convert from euler?

#

I don`t have euler but a quaternion.

simple compass
#

I mean, store your rotation as float

#

but apply rotation to object through conversion

random oasis
#

the rotation comes from Rival character controller

simple compass
#

ah

random oasis
#

maybe this can help?

#

if i can reimplement it using the math library

gaunt spade
#

Sorry maybe that doesn't answer the question.