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

  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,718

    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,718

    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
    492

    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.

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

    Re: SLERP - Quaternion Interpolation

    Hi Carsten,

    thank you very much for your information. Well, I would appreciate SLERP instead of LERP, as SLERP should provide better smoothnes.

    Thank you very much, indeed.

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

    Re: SLERP - Quaternion Interpolation

    It does SLERPing. You can see it in the implementation, regardless of what the documentation says.

  9. #9
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    936

    Re: SLERP - Quaternion Interpolation

    Yes, it's a documentation error.

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

    Re: SLERP - Quaternion Interpolation

    Thanks folks.

Posting Permissions

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