Results 1 to 4 of 4

Thread: Accumulating rotations

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2009
    Posts
    4

    Accumulating rotations

    Hello,

    I'm trying to implement an arcball.
    I'm using glRotate() and i would like to accumulate the rotation in order for the object to start rotating from the last position and not reset to it's origin position.

    i've tried using glGet(MODELVIEW,matrix) after calling glRotate() and using multMatrix(matrix) before and it doesn't seems to work..

    thanks in advance..

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,653

    Re: Accumulating rotations

    Quote Originally Posted by Amit5
    I'm trying to implement an arcball.
    I'm using glRotate() and i would like to accumulate the rotation in order for the object to start rotating from the last position and not reset to it's origin position.

    i've tried using glGet(MODELVIEW,matrix) after calling glRotate() and using multMatrix(matrix) before and it doesn't seems to work..
    Let's see some code.

    I understand what you're saying, but there's something missing here as that "just works".

  3. #3
    Senior Member Frequent Contributor scratt's Avatar
    Join Date
    May 2008
    Location
    Thailand
    Posts
    555

    Re: Accumulating rotations

    There's quite a nice little web page about this actually : http://www.rainwarrior.thenoos.net/dragon/arcball.html

    I found it one day looking for something else.

    One thing I would say is that for anything that free rotates then putting together a nice Matrix and Quaternion class I found makes things a lot smoother. There are plenty of nice examples out there you can Google for. Quaternions are not *required* to do this, but the way that you can rotate trivially without getting Gimbal lock when using Quaternions is very helpful.

    And the best thing is you don't have to actually understand Quaternions if you don't wish to.

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Sep 2004
    Location
    Prombaatu
    Posts
    1,386

    Re: Accumulating rotations


Similar Threads

  1. Accumulating min/max bounds with transform feedback?
    By raga34 in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 05-27-2014, 09:21 AM
  2. Accumulating Rotation and Translation Matrices
    By potpan in forum OpenGL: General
    Replies: 3
    Last Post: 11-21-2010, 05:30 AM
  3. VP rotations
    By MojoMagic in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 02-25-2004, 07:12 PM
  4. Rotations
    By jhc in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 04-03-2003, 07:15 AM
  5. Accumulating Transformations & Rotations
    By Siwko in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 10-20-2000, 03:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean