Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 10 of 10

Thread: SLERP - Quaternion Interpolation

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2011
    Posts
    22

    SLERP - Quaternion Interpolation

    Dear all,

    Is Quaternion Interpolation (SLERP) function available in (GLM)GLMath? I simply can not find it. In my opinion, it is quite necesary function. If it not yet present, I would strongly vote for implementing it.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,732

    Re: SLERP - Quaternion Interpolation

    If you're talking about GLM, it's available as an overload of the "mix" function.

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2011
    Posts
    22

    Re: SLERP - Quaternion Interpolation

    Hi Alfonse,

    yes, I was talking about GLM. Would you be so kind to tell me where to find that "mix" function? I discovered GLM today, so probably, I do not know yet, where is what I need. Thanks.

  4. #4
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,732

    Re: SLERP - Quaternion Interpolation

    Would you be so kind to tell me where to find that "mix" function?
    It's defined in the same file you include to get access to quaternions. Like all GLM types and functions, it is defined in the "glm" namespace.

  5. #5
    Junior Member Newbie
    Join Date
    Feb 2011
    Posts
    22

    Re: SLERP - Quaternion Interpolation

    Ah, I will have to include Quaternions extenstion of GLM. Thank you very much. I am happy to have SLERP.

  6. #6
    Member Regular Contributor
    Join Date
    Apr 2010
    Posts
    495

    Re: SLERP - Quaternion Interpolation

    Code :
    //! Returns a LERP interpolated quaternion of x and y according a. 
    //! From GLM_GTC_quaternion extension.
     
        template <typename T> 
        detail::tquat<T> mix(
            detail::tquat<T> const & x, 
            detail::tquat<T> const & y, 
            typename detail::tquat<T>::value_type const & a);

    unless I'm missing something (quite possible I'm not using GLM) it only does a lerp not slerp.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •