Skip to content

quartanion rotation #960

@ginnekochan

Description

@ginnekochan

Hello!

In ext/quaternion_transform.inl
function rotate definition's last line...

return q * qua<T, Q>(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin);

seems to be mistaken, and should be...

return qua<T, Q>(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin) * q;

below is snippet from my program...

//drag_ = glm::rotate(orig_, 2 * ar, vec3(dy, dx, 0.f)); // doesn't work
glm::quat dq = glm::rotate(glm::quat(1, 0, 0, 0), 2 * ar, vec3(dy, dx, 0.f)); drag_ = dq * orig_; // ok.

I want to add another rotation over orig_, but first line doesn't work.

Sorry for my poor English. (I'm Japanese.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions